我正在使用弹性搜索 5.2.2。
在我的索引中,我的数据如下所示:
{
"_index": "index",
"_type": "273caf76-ec03-478c-b980-9743180bc863",
"_id": "eee46e24-f383-4ae7-8930-dc3836e030a5",
"_score": 3.41408,
"_source": {
"Father Name": [
{
"id": "some id",
"value": "Some value test test"
}
],
"Mother Name": [
{
"id": "some id",
"value": "Another value haha"
}
],
"Other values": [{ id: "", value: ""}]
}
}
当我使用 _all 进行搜索时,一切正常,我可以找到具有合理分数的所有结果
{"query":{"match":{"_all":"value"}},"from":0,"size":20}
但是该查询正在所有字段中搜索。如果我要为实例,只是为了找到导致Father Name
或Father Name
和Mother Name
,然后我找到什么。
{"query":{"match":{"Father Name":"value"}},"from":0,"size":20}
我的目标是找到类似 _all 的搜索,但仅限于几个字段。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句