Geo_shape indexing and querying


(jason haddix) #1

Hi there. I have a collection of geo_shapes pulled from a shape file that I have indexed into ES. I also have a large index of documents with geo_points. I'm trying to run a query that returns all the documents that have a point within a geo_shape, but keep getting zero results returned. What am I doing wrong or not understanding?

Here is the mapping for my geo_shapes:
{
"locations":{
"properties": {
"type": "geo_shape",
"tree":"quadtree"
}
}
}

and this is the mapping for the documents with geo_points:
{
"docs":{
"location":{
"properties":{
"coordinates":{
"type":"geo_point",
"geohash":true
}
}
}
}
}

the query I'm trying to run is:

{"query":
"geo_shape": {
"geometry": {
"indexed_shape": {
"id": "shape_id",
"type": "locations",
"index": "index_name",
"path": "geometry"
}
}
}

I'm pretty sure the mappings are correct, because I can do a query of a specific lat/long and successfully get back the geo_shape it is in. I can also do a bounding box search of the documents with geo_points and successfully get back a list of documents that match.


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.