0
我有一個關於elasticsearch的問題。elasticsearch geo距離查詢失敗
我使用我的表內的下一個映射。 (geonames表)
{
"zoek": {
"mappings": {
"geo": {
"properties": {
"country": {
"type": "string"
},
"geonameid": {
"type": "string"
},
"locatie": {
"type": "geo_point"
},
"name": {
"type": "string"
}
}
}
}
}
}
「locatie」是來自double數組的geo_point映射。
因此搜索我們的當地村「李承晚」正常工作:
GET /zoek/geo/_search
{
"query": {
"match": { "name": "rhee" }
}
}
答:
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 8.156567,
"hits": [
{
"_index": "zoek",
"_type": "geo",
"_id": "4533",
"_score": 8.156567,
"_source": {
"geonameid": "2748193",
"name": "Rhee",
"locatie": [
53.0325,
6.56667
],
"country": "NL"
}
}
]
}
}
- >現在我想從「李承晚查詢在15公里半徑的所有地方「 (例如)
GET /zoek/geo/_search
{
"filtered" : {
"query" : {
"match": { "name": "rhee" }
},
"filter" : {
"geo_distance" : {
"distance" : "15km",
"locatie" : [ 53.0325, 6.56667 ]
}
}
}
}
}
下引發異常:
SearchPhaseExecutionException [無法執行階段[查詢],所有碎片失敗; shardFailures
解析失敗[無解析器元素[過濾]]]
而且,這個查詢:
get /zoek/geo/_search
{
"query": {
"filtered": {
"filter": {
"geo_distance": {
"distance": "5km",
"locatie": [ 53.0325, 6.56667 ]
}
}
}
}
}
}
返回所有領域而不是5公里的距離記錄。
有什麼建議嗎?
和平,
的Digi