In elasticsearch, I want to query multiple indices with a geo_distance filter.
The issue is that one index has geo_point mapping and the other has no geo_point mapping.
If I query using latitude and longitude, I am getting results only for the index which has geo_point mapping. For the other index I am getting failed to find geo_point field exception.
How can I get the results from both indices?
Following is my query.
{
"query":{
"filtered":{
"query":{
"bool":{
"should":{
"match_all":{
}
}
}
},
"filter":{
"bool":{
"should":[
{
"bool":{
"must":[
{
"geo_distance":{
"distance":"50km",
"location":{
"lat":22.5705741,
"lon":88.4355427
}
}
}
]
}
}
]
}
}
}
},
"sort":[
{
"_geo_distance":{
"location":{
"lat":22.5705741,
"lon":88.4355427
},
"order":"asc",
"unit":"km"
}
}
],
"size":30,
"from":0
}
I am using elasticsearch verion 0.90.12
type
filter and combine thegeo_distance
filter with thetype
one on the type that has the geo_point. But if the geo_distance is the only filter you have, I don't see the point of retrieving results from another index that doesn't have any geo-ish information. – Val