Indexing zip boundary data - results in poor performance

Hi ,

I am trying to index zip code boundary data and during my search query I
need to identify the zip boundary where the input lat/long is present. I
have data for 22000 zip code and with each boundary I have a number of
documents that vary from 1 to 100.

I have observed that indexing zip code boundary data takes a lot of time
and the input query also takes a lot of time.

Please let me know how I can efficiently index zipcode boundary data to get
optimal performance.

My mapping is

"zipboundary" : {
"properties" : {
"zipgeoboundary" : { "type" : "geo_shape", "precision" :
"1mi", "index":"analyzed", "store":"yes"},
"adgroup" : {
"type" : "nested",
"properties" : {
"name" : {"type" : "string", "index":"no",
"store" : "yes"},
"caption" : {"type" : "string", "index":"no",
"store" : "yes"},
"adtype" : {"type" : "string", "index":"no",
"store" : "yes"},
"active" : {"type" : "string", "index":"no",
"store" : "yes"},
"publisher" : {
"type" : "nested",
"properties" : {
"name" : { "type" : "string", "index" :
"analyzed", "store" : "yes" },
"bid" : { "type" : "double", "index" :
"no", "store" : "yes" },
"budget" : { "type" : "double", "index"
: "analyzed", "store" : "yes" }
}
}
}
}
}
}

and sample data for 1 record is (actual index has 22000 boundaries)

{"create":{"_index":"ads","_id":"94151","_type":"zipboundary"}}
{"zipgeoboundary":{"coordinates":[[-122.419,37.775],[-122.418,37.775]],"type":"envelope"},"adgroup":[{"id":"1-13834850","geolocation":[{"lat":"37.7206","lon":"-122.4428"}]},{"id":"1-652835","geolocation":[{"lat":"37.732","lon":"-122.3901"}]},{"id":"1-9755763","geolocation":[{"lat":"37.4044","lon":"-122.0759"}]},{"id":"1-14777644","geolocation":[{"lat":"37.6225","lon":"-122.3964"}]},{"id":"1-14054526","geolocation":[{"lat":"37.3484","lon":"-121.8873"}]}]}

and the query that I am trying to run is

{
"size" : 100,
"query" : {
"bool" : {
"must" : [
{ "geo_shape" : {
"zipgeoboundary" : {
"shape" : {
"type" : "point",
"coordinates" : [-74.0059731, 40.7143528]
}
}
}
}
]
}
}
}

My query response is > 200 ms.

Please help me resolve the issue.

Regards,
Deep

--
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.