0
我在lastName
字段中按照某种方式出现必须具有“Thomas”的文档来查询我的索引,并且还应根据geo_point
查询返回返回结果。 geo_point
查询出现在should
子句中,因为可能有多个传入。如果有任何匹配,我希望文档以命中形式返回。任何想法为什么这不起作用?我遵循文档as outlined here。为什么不是使用组合查询的Elasticsearch查询返回预期结果?
“应:至少其中一个查询必须匹配等效的OR。”
{
"sort": [{
"_score": {
"order": "desc"
}
}],
"query": {
"bool": {
"must": [{
"query_string": {
"default_field": "lastName",
"query": "Thomas"
}
}],
"should": [{
"geo_distance": {
"distance": "5mi",
"coordinates": "32.798913, -79.998085"
}
}]
}
}
}
你肯定你的'coordinates'字段类型'geo_point'? – Val
是的,的映射是正确的 – sean
你确定'坐标'首先是指定纬度,然后是经度而不是其他的方式吗? – Val