在我创建的elasticsearch模块中,是否可以在搜索结果中返回“输入搜索项”?返回“搜索项”以及结果 - Elasticsearch
例如:
GET /signals/_search
{
"query": {
"match": {
"focused_content": "stock"
}
}
}
这将返回
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.057534903,
"hits": [
{
"_index": "signals",
"_type": "signal",
"_id": "13",
"_score": 0.057534903,
"_source": {
"username": "[email protected]",
"tags": [
"News"
],
"content_url": "http://www.wallstreetscope.com/morning-stock-highlights-western-digital-corporation-wdc-fibria-celulose-sa-fbr-ametek-inc-ame-cott-corporation-cot-graftech-international-ltd-gti/25375462/",
"source": null,
"focused_content": "Morning Stock Highlights: Western Digital Corporation (WDC), Fibria Celulose SA (FBR), Ametek Inc. (AME), Cott Corporation (COT), GrafTech International Ltd. (GTI) - WallStreet Scope",
"time_stamp": "2015-08-12"
}
}
]
}
是否有输入搜索词“股”可能与每一结果(如连同额外的JSON重点沿“ content_url“,”source“,”focused_content“,”time_stamp“)来标识哪个搜索词带来了该结果?
在此先感谢!