1
저는 ElasticSearch 1.1.0을 사용 중이며 지리 정보 필터를 사용하려고합니다.elasticSearch geoPoint와 관련된 문제
여기 여기 내 문서
"address": {
"postcode": "29004",
"city": "Málaga",
"state": "Málaga",
"region": "Málaga",
"country": "espagne",
"location": {
"lat": 36.68676,
"lon": -4.49028
}
}
내 매핑
{
"dynamic": "true",
"numeric_detection": true,
"properties": {
"address": {
"type": "nested",
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"location": {
"type": "geo_point"
},
"postcode": {
"type": "integer"
},
"region": {
"type": "string"
},
"state": {
"type": "string"
}
}
}
}
}
입니다 (매핑은 문서를 색인 전에 만들어진, 그리고 문서가 잘 인덱스입니다). 그러나 다음 쿼리 문자열을 사용하여이 annonce를 가져 오려고하면
{
"query": {
"filtered": {
"query": {
"match_all": {
}
},
"filter": {
"geo_distance": {
"distance": "200km",
"address.location": {
"lat": 36.68676,
"lon": -4.49028
}
}
}
}
}
}
나는 결과를 얻지 못했습니다. 이유를 이해할 수 없습니다. 내가 뭔가 잘못하고 있는거야? 당신의 도움을 주셔서 감사합니다 :) !
https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-geo-point-type.html#_mapping_options이 최종 구조가 어떻게 생겼는지 한 ... long_lat 매핑 옵션을 설정 잊으 셨나요? –