dkp*_*997 6 elasticsearch elasticsearch-5
Elasticsearch像Unknown key for a START_OBJECT in [bool]Elasticsearch 一样给出了这个错误.
我的查询如下:更新
var searchParams = {
index: 'offers',
body:{
query:{
bool : {
must : {
query: {
multi_match: {
query: query,
fields:['title','subTitle','address','description','tags','shopName'],
fuzziness : 'AUTO'
}
}
},
filter : {
geo_distance : {
distance : radius,
location : {
lat : latitude,
lon : longitude
}
}
}
}}},
filter_path :'hits.hits._source',
pretty:'true'
};
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何在弹性搜索中混合使用地理和模糊搜索查询?
Val*_*Val 12
本body应该是这样的(你缺少的query部分):
body:{
query: { <--- add this
bool : {
must : {
multi_match: {
query: query,
fields:['title','subTitle','address','description','tags','shopName'],
fuzziness : 'AUTO'
}
},
filter : {
geo_distance : {
distance : radius,
location : {
lat : latitude,
lon : longitude
}
}
}
}}},
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5733 次 |
| 最近记录: |