# Mapper parsing exception?

**URL:** <https://discuss.elastic.co/t/mapper-parsing-exception/94617>\
**Category:** Elasticsearch\
**Created:** [July 26, 2017, 10:24am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/94617 "2017-07-26T10:24:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cabane77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cabane77/32/20414_2.png) [@cabane77](https://discuss.elastic.co/u/cabane77)\
**Post date:** [July 26, 2017, 10:24am UTC](https://discuss.elastic.co/t/mapper-parsing-exception/94617/1 "2017-07-26T10:24:24Z")

</div>

Hi,  
I wonder if anyone could help on the below error? I am trying to import some spatial data into elastic search, using ogr2ogr, but I am getting the below error:

**error":{"type":"mapper\_parsing\_exception","reason":"failed to parse [geometry]","caused\_by":{"type":"array\_index\_out\_of\_bounds\_exception","reason":"-1"}}**

On the server side, the error is:  
failed to execute bulk item (index) BulkShardRequest [[index][0]] containing [index {[index][FeatureCollection][AV15m2nWhhQ-IblS1nLK], source[n/a, actual length: [4.2mb], max length: 2kb]}]

The geometry is a very big one, is there any way that i can increase the max length, and if yes, would this be a good thing to do?

---

<div class="post-metadata">

**Author:** ![pkeidel](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pkeidel](https://discuss.elastic.co/u/pkeidel)\
**Post date:** [August 11, 2017, 12:09pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception/94617/2 "2017-08-11T12:09:06Z")

</div>

Hi, I had a similar problem today and searched in the code for the error message. It looks like the size is hard coded to 2kb:

```
$ grep -Rn "max length:" *
core/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java:206: "], max length: " + new ByteSizeValue(IndexRequest.MAX_SOURCE_LENGTH_IN_TOSTRING).toString() + "]}", request.toString());
core/src/main/java/org/elasticsearch/action/index/IndexRequest.java:577: sSource = "n/a, actual length: [" + new ByteSizeValue(source.length()).toString() + "], max length: " +
$ grep -Rn "MAX_SOURCE_LENGTH_IN_TOSTRING =" *
core/src/main/java/org/elasticsearch/action/index/IndexRequest.java:82: static final int MAX_SOURCE_LENGTH_IN_TOSTRING = 2048;

```

So I think we have to keep the source as small as posible.

---

<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:** [September 8, 2017, 12:09pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception/94617/3 "2017-09-08T12:09:18Z")

</div>

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