0
我想,距離我的中心位置的最大距離在我elasticsearch查詢上geo_distance過濾,還有與分選部分沒有問題:在elasticsearch
{
"query" : {
"match_all" : {}
},
"sort" : [
{
"_geo_distance" : {
"location" : "56,14",
"order" : "asc",
"unit" : "km"
}
}
]
}
然而
,當我嘗試添加一個過濾器,我得到"[geo_distance] filter does not support [location]"
:
{
"query" : {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "200m",
"location" : {
"location" : "56,14"
}
}
}
}
},
"sort" : [
{
"_geo_distance" : {
"location" : "56,14",
"order" : "asc",
"unit" : "km"
}
}
]
}
任何想法我做錯了什麼?
你可以試試「當前位置。位置「根據http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-filter.html#_lat_lon_as_string_4 – cfrick
他們使用pin.location的原因是他們保存在一個次要的針的位置,我沒有保存我的位置在一個子這樣的 – Touchpad