極力打造的搜索如下:ElasticSearch QueryParsingException未能找到geo_point場
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geo_distance": {
"distance": "50km",
"coordinates": {
"lat": 52.5234051,
"lon": 4.113999
}
}
}
}
}
}
其中座標的類型是'geo_point'的。
但是當我嘗試運行此查詢時,elasticsearch.log一個錯誤彈出: [位置]未能找到geo_point場[座標]
編輯:
這是部分of/locations/location/_mapping:
{
"locations": {
"mappings": {
"location": {
"properties": {
...
"coordinates": {
"properties": {
"lat": {
"type": "string"
},
"lon": {
"type": "string"
}
}
},
...
}
}
任何想法這裏有什麼問題嗎?
什麼我們地理點的字段名? – BlackPOP
@BlackPOP:請參閱原始文章的編輯 –
我認爲你沒有在映射中使用geo_point ..請參閱http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type。 html – BlackPOP