これが私の問題です。フィールドを持つインデックスにいくつかのデータが格納されています"location"
。マッピングはこちら
{
"data":{
"properties":{
...
"location":{
"type": "geo_point",
"lat_lon": true,
"store": "yes"
},
...
}
}
}
これは、インデックスに存在するデータの例です
{
"metadata": {
"total": 2887,
"maxScore": 4.8634477
},
"data": [
{
"_index": "data",
"_type": "data",
"_id": "8-HtWNILQrqrobwchhgNIQ",
"_score": 4.8634477,
"_source": {
"generique": "Chemin",
"_datasetId": "5175b2b4a652945a0500000d",
"liaison": "",
"specifique": "Sainte-Foy",
"direction": "",
"nomTopo": "Chemin Sainte-Foy",
"ville": "Québec",
"arrond": "Sainte-Foy-Sillery-Cap-Rouge",
"location": {
"lon": -71.322135,
"lat": 46.768526
}
}
},
{
"_index": "data",
"_type": "data",
"_id": "sSZ3u-uDQIuPDc2qnPir0g",
"_score": 4.8634477,
"_source": {
"generique": "Chemin",
"_datasetId": "5175b2b4a652945a0500000d",
"liaison": "",
"specifique": "Sainte-Foy",
"direction": "",
"nomTopo": "Chemin Sainte-Foy",
"ville": "Québec",
"arrond": "Sainte-Foy-Sillery-Cap-Rouge",
"location": {
"lon": -71.286977,
"lat": 46.784508
}
}
}
]
}
geo_distance でリクエストを実行したい場合、無関係なデータが返されました。
リクエストはこちら
{
"query": {
"filtered": {
"query_string": {
"query": "_datasetId:5175b2b4a652945a0500000d"
},
"filter": {
"geo_distance": {
"location": {
"lat": 46.815569,
"lon": -71.208401
},
"distance": "1km"
}
}
}
}
}
受信したデータには、権利が含まれておらず、クエリで指定されたものから近いもの"_datasetId"
も含まれていません。"location"
私は十分に明確であることを願っていますありがとう。