# Elasticsearch indexing is low when there are area fields

**URL:** <https://discuss.elastic.co/t/elasticsearch-indexing-is-low-when-there-are-area-fields/176613>\
**Category:** Elasticsearch\
**Created:** [April 12, 2019, 11:44am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-is-low-when-there-are-area-fields/176613 "2019-04-12T11:44:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel.ortin](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@joel.ortin](https://discuss.elastic.co/u/joel.ortin)\
**Post date:** [April 12, 2019, 11:44am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-is-low-when-there-are-area-fields/176613/1 "2019-04-12T11:44:38Z")

</div>

Elasticsearch version : 6.4.0  
Logstash version: 6.4.0

I'm using logstash to import data to Elasticsearch and indexing speed is really decreased when there are area type fields.

The number of documents I'm importing is 58.000 and every of these documents has a nested object with an area field type.  
"stores": {  
"type": "nested",  
"properties": {  
"id": {"type": "long"},  
"normalized\_name": {"type": "keyword"},  
"area": {"type": "geo\_shape", "tree": "quadtree", "precision": "2km"},  
"location": {"type": "geo\_point"}  
}  
}  
The implementation I'm using for the area type is an envelope and is imported in logstash using the json function  
It takes half an hour to complete the indexing and if I remove this nested object, it takes only 2 minutes.  
There is a reason for this, I'm doing something wrong?

Thanks

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [April 12, 2019, 12:14pm UTC](https://discuss.elastic.co/t/elasticsearch-indexing-is-low-when-there-are-area-fields/176613/2 "2019-04-12T12:14:12Z")

</div>

This is a know issue with geo\_shape field types. This is the reason that from Elasticsearch version 6.6 it was added a new indexing strategy based in the BKD tree.

[https://www.elastic.co/guide/en/elasticsearch/reference/6.7/geo-shape.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/geo-shape.html)

If you want to speed up indexing you can upgrade to a version higher than 6.6. Is that an option for you?

---

<div class="post-metadata">

**Author:** ![joel.ortin](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@joel.ortin](https://discuss.elastic.co/u/joel.ortin)\
**Post date:** [April 15, 2019, 6:37am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-is-low-when-there-are-area-fields/176613/3 "2019-04-15T06:37:51Z")

</div>

Thanks Ignacio,

Yes, I'll try it.

---

<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:** [May 13, 2019, 6:47am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-is-low-when-there-are-area-fields/176613/4 "2019-05-13T06:47:32Z")

</div>

Closed on May 13, 2019, 6:47am UTC

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