I am having an issue figuring out how to represent a geo_bounding_box query
for a geo_point field which is located in a nested document. It seems to be
having an issue finding the field in the nested document. I tried leaving
out the nested clause (just using document_b.location in the
geo_bounding_box) too but that did not seem to work either. Here is a
simplified test case of what I am trying to do:
curl -XDELETE localhost:9200/geo_test
echo "Map"
curl -XPUT localhost:9200/geo_test -d '{
"mappings": {
"document_a": {
"properties": {
"name": {"type": "string"},
"document_b": {
"type": "nested",
"properties": {
"location": {
"type": "geo_point",
"lat_lon": "true"
}
}
}
}
}
}
}'
echo
echo "Insert"
curl -XPUT localhost:9200/geo_test/document_a/2 -d '{
"id": 2,
"name": "MyTest",
"document_b": {
"location":{
"lat": 32.9,
"lon": 69.25
}
}
}'
echo
echo "Refresh"
curl -XPOST localhost:9200/geo_test/_refresh
echo
echo "Query"
curl -XPOST "localhost:9200/geo_test/geo_test/_search?pretty=true" -d '{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"nested": {
"path": "document_b",
"query": {
"filtered":{
"query": {"match_all": {}},
"filter": {
"geo_bounding_box" : {
"location" : {
"top_left" : {
"lat" : 32.9,
"lon" : 69.25
},
"bottom_right" : {
"lat" : 33.0,
"lon" : 69.5
}
}
}
}
}
}
}
}
}
}
}'
echo
The error that I am getting is
nested: QueryParsingException[[geo_test] failed to find geo_point field
[location]]
Any help is greatly appreciated.
Ray
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.