2014-05-12 31 views
6

極力打造的搜索如下: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" 
     } 
     } 
    }, 
    ... 
} 
} 

任何想法這裏有什麼問題嗎?

+0

什麼我們地理點的字段名? – BlackPOP

+0

@BlackPOP:請參閱原始文章的編輯 –

+2

我認爲你沒有在映射中使用geo_point ..請參閱http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type。 html – BlackPOP

回答

9

問題是mapping.you需要在映射中使用geo_point .. refer this

+1

編輯最新的鏈接..! – BlackPOP

+0

我有同樣的問題,你能解釋一下嗎? – mhndev

相關問題