# Indexing zip boundary data - results in poor performance

**URL:** <https://discuss.elastic.co/t/indexing-zip-boundary-data-results-in-poor-performance/12589>\
**Category:** Elasticsearch\
**Created:** [June 30, 2013, 5:50pm UTC](https://discuss.elastic.co/t/indexing-zip-boundary-data-results-in-poor-performance/12589 "2013-06-30T17:50:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deep\_2](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Deep\_2](https://discuss.elastic.co/u/Deep_2)\
**Post date:** [June 30, 2013, 5:50pm UTC](https://discuss.elastic.co/t/indexing-zip-boundary-data-results-in-poor-performance/12589/1 "2013-06-30T17:50:27Z")

</div>

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:28am UTC](https://discuss.elastic.co/t/indexing-zip-boundary-data-results-in-poor-performance/12589/2 "2017-07-06T02:28:53Z")

</div>

Closed on July 6, 2017, 2:28am UTC


