# Upgrade from elastic 1.3.2 to 2.3.1 and more space for the indexes

**URL:** https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437
**Category:** Elasticsearch
**Created:** [May 6, 2016, 8:56pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437 "2016-05-06T20:56:17Z")
**Posts on this page:** 14
**Page:** 2

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [May 24, 2016, 3:36pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/21 "2016-05-24T15:36:01Z")

</div>

Simon,  
I can do that, I will write something up and report back.

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 2, 2016, 4:54pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/22 "2016-06-02T16:54:34Z")

</div>

Simon  
I wrote a small C# .NET app to index directly into ES, I got the same size differences and really slow indexing.

For ES 1.7.2 I used [NEST client](https://github.com/elastic/elasticsearch-net) 1.7.2, For ES 2.3.2 I used NEST client 2.3.2, however I think the 1.7.2 client was able index in ES 2.3.2, anyway I tested with different client s to adhere to the supported ES/Client combinations.

Stats from head plugin  
ES 1.7.2  
upgarde-test  
size: 15.5Mi (15.5Mi)  
docs: 2,000 (2,000)

ES 2.3.2  
upgarde-test  
size: 2.84Gi (2.84Gi)  
docs: 2,000 (2,000)

Mapping (Same mapping)  
`{ "mappings": { "tomato": { "_all" :{ "enabled" : false }, "properties": { "id": { "type": "string", "index": "not_analyzed", "doc_values": false }, "dateTimeCreated": { "type": "date" }, "dateTimeModified": { "type": "date" }, "name": { "type": "string" }, "description": { "type": "string" }, "isPublic": { "type": "boolean" }, "tomatoCenter": { "type": "geo_point", "geohash": true, "geohash_prefix": true, "geohash_precision": 3 }, "tomatoShape": { "type": "geo_shape", "tree": "quadtree", "precision": "1m" }, "type": { "type": "string" }, "farmId": { "type": "string", "index": "not_analyzed", "doc_values": false } } } } }`

Same Content (Sample), all shapes are "circle"  
`{ "_index": "upgarde-test", "_type": "tomato", "_id": "AVURtqKTfJzofNCcHO8s", "_version": 1, "_score": 1, "_source": { "description": "Random batchNo5 #tomatoIdx3", "tomatorShape": { "coordinates": [-87.21241972439854 , 41.53887701360597], "type": "circle", "radius": 4444 }, "tomatoCenter": [-87.21241972439854 , 41.53887701360597], "isPublic": true, "name": "Batch#5 Count#3", "tags": ["batchNo5" , "tomatoIdx3"], "type": "tomato", "farmId": "farm_c6840442-7312-473c-8501-ed035dcc65bf", "dateTimeCreated": "0001-01-01T00:00:00" } }`

C# code to index

```
var bulkDescriptor = new BulkDescriptor();
            for (int b = 0; b < 200; b++)
            {
                var tomato= GetRandomTomato(i, b);
                bulkDescriptor.Index<Tomato>(op => op.Document(tomato).Index(EsIndexName));
            }

            var result = ElasticNestClient.Bulk(bulkDescriptor);
```

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 2, 2016, 6:36pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/23 "2016-06-02T18:36:49Z")

</div>

Similar issue reported [here](https://discuss.elastic.co/t/elasticsearch-upgrade-from-1-7-1-to-2-3-2-then-create-index-very-slow/51655)

---

<div class="post-metadata">

### Author: ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)
#### Post date: [June 3, 2016, 9:42am UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/24 "2016-06-03T09:42:34Z")

</div>

I replied to the other issue, [Elasticsearch upgrade from 1.7.1 to 2.3.2 then create index very slow](https://discuss.elastic.co/t/elasticsearch-upgrade-from-1-7-1-to-2-3-2-then-create-index-very-slow/51655/29?u=s1monw)

do you think you can do the same?

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 3, 2016, 2:33pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/25 "2016-06-03T14:33:04Z")

</div>

Whoa!

I just did that, it made day & night difference.  
Index size is even smaller now in the new ES version 15Mi old vs 12.8Mi new, indexing speed is also almost instantaneous considering I just indexed 2000 docs.  
ES 2.3.2  
upgarde-test  
size: 12.8Mi (12.8Mi)  
docs: 2,000 (2,000)

Before I was using separate new data folder for the new version, now I created the index in the old version (just index create and no data), used the same data folder for the new version, then indexed data using the new ES version.

Will you be doing any fix for this?should we wait for a fix?

---

<div class="post-metadata">

### Author: ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)
#### Post date: [June 3, 2016, 2:45pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/26 "2016-06-03T14:45:46Z")

</div>

do you think you can provide me a reproduction including data? I think I need to go an debug this myself but we have at least a smoking gun now.

---

<div class="post-metadata">

### Author: ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)
#### Post date: [June 3, 2016, 2:48pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/27 "2016-06-03T14:48:04Z")

</div>

> Will you be doing any fix for this?should we wait for a fix?

of course, this is like a major regression! yet I still don't know what's going on but please bare with me and help me to figure it out!

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 3, 2016, 3:32pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/28 "2016-06-03T15:32:07Z")

</div>

I can sure, just let me know what do you need in detail.  
Thanks!

---

<div class="post-metadata">

### Author: ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)
#### Post date: [June 3, 2016, 3:48pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/29 "2016-06-03T15:48:13Z")

</div>

If you provide me the code and the data that would be awesome?

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 4, 2016, 12:06am UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/30 "2016-06-04T00:06:19Z")

</div>

[Here](https://github.com/Molenx/elasticsearch-upgrade-test) is the test app on GitHub, it is a C# Windows console app.  
It generates the data and indexes it into ES using the NEST client, each run will generate/index 2000 docs, you can set the ES node url and index name from the App.config (ElasticUpgradeTest.exe.config) file.

There is a compiled exe in the Compiled folder, or you can use Visual Studio 2015 to open the solution and run it from there, the app targets .NET Framework 4.5.2.

The mapping is in the mapping.txt file, it is just one type with some geo fields.

I was able to reproduce the issue using this app, you probably won't need my index data files as they are all generated using the app, if you needed it I can provide it too.

Let me know if you had issues running it.

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 4, 2016, 2:13am UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/31 "2016-06-04T02:13:38Z")

</div>

Another debug info, I think what is causing the problem is the geo fields.

Assuming normal scenario, I create the index then index the data in a new ES version, if I don't set values for my geo fields (simply comment line 73 in my app [DataGenerator.cs](https://github.com/Molenx/elasticsearch-upgrade-test/blob/master/ElasticUpgradeTest/DataGenerator.cs) then everything is good (index size is under 1Mi), but if I set values for my geo fields things go nuts, will work if I only use the work around you mentioned earlier.

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [June 4, 2016, 1:20pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/32 "2016-06-04T13:20:17Z")

</div>

I think this is the same as [https://github.com/elastic/elasticsearch/issues/17907](https://github.com/elastic/elasticsearch/issues/17907)

Try changing your geo-shape mapping to specify:

```
"distance_error_pct": 0.025

```

See [https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html) for the docs

---

<div class="post-metadata">

### Author: ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://discuss.elastic.co/u/dom)
#### Post date: [June 5, 2016, 3:26am UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/33 "2016-06-05T03:26:59Z")

</div>

That fixed my problem, thanks!

I would ask though why this behavior was changed from 1.x version? I don't know the full business/technical case but would like to know.

I would say "distance\_error\_pct" should never be zero unless it is set explicitly.

Thinking more about it and considering the size difference and indexing speed I would say that parameter should never be zero.

---

<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 5, 2017, 10:46pm UTC](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437/34 "2017-07-05T22:46:08Z")

</div>



[Previous page](https://discuss.elastic.co/t/upgrade-from-elastic-1-3-2-to-2-3-1-and-more-space-for-the-indexes/49437.md?page=1)
