# Type storage issues

**URL:** <https://discuss.elastic.co/t/type-storage-issues/3066>\
**Category:** Elasticsearch\
**Created:** [July 3, 2010, 12:19am UTC](https://discuss.elastic.co/t/type-storage-issues/3066 "2010-07-03T00:19:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 3, 2010, 12:19am UTC](https://discuss.elastic.co/t/type-storage-issues/3066/1 "2010-07-03T00:19:22Z")

</div>

It looks like Elastic Search is overriding my default mapping values when it  
adds defaults dynamically.

I'm seeing ints being stored as longs and floats and double being stored as  
string when using  
client.admin().indices().create(createRequest)

Dates appear fine.

Here is part of the value used in createRequest.settings(value):  
"trxamount":{"type":"double","boost":1}

Here is what I see in the logs:  
trxamount":{"type":"string","index\_name":"trxamount","index":"analyzed","store":"no","term\_vector":"no","boost":1.0,"omit\_norms":false,"omit\_term\_freq\_and\_positions":false}

I initially create an index using mappings, I don't provide all the fields  
such term\_vector omit\_terms etc, so Elastic Search is dynamically adding  
them later when I perform an index.  
It looks like it is overriding my mappings.

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 3, 2010, 12:23am UTC](https://discuss.elastic.co/t/type-storage-issues/3066/2 "2010-07-03T00:23:33Z")

</div>

I created [Type storage issues · Issue #244 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/244) for  
this.

On Fri, Jul 2, 2010 at 5:19 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com) wrote:

> It looks like Elastic Search is overriding my default mapping values when  
> it adds defaults dynamically.
> 
> I'm seeing ints being stored as longs and floats and double being stored as  
> string when using  
> client.admin().indices().create(createRequest)
> 
> Dates appear fine.
> 
> Here is part of the value used in createRequest.settings(value):  
> "trxamount":{"type":"double","boost":1}
> 
> Here is what I see in the logs:
> 
> trxamount":{"type":"string","index\_name":"trxamount","index":"analyzed","store":"no","term\_vector":"no","boost":1.0,"omit\_norms":false,"omit\_term\_freq\_and\_positions":false}
> 
> I initially create an index using mappings, I don't provide all the fields  
> such term\_vector omit\_terms etc, so Elastic Search is dynamically adding  
> them later when I perform an index.  
> It looks like it is overriding my mappings.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 4, 2010, 8:50am UTC](https://discuss.elastic.co/t/type-storage-issues/3066/3 "2010-07-04T08:50:15Z")

</div>

Can you explain how you set the mappings in the API? You don't set them  
through the settings on the createRequest, there is an API to put mappings,  
or add mappings as part of the API to create an index. If you provide  
explicit mappings, then elasticsearch should not override what you provided.

-shay.banon

On Sat, Jul 3, 2010 at 3:23 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com) wrote:

> I created [Type storage issues · Issue #244 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/244for) this.
> 
> On Fri, Jul 2, 2010 at 5:19 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > It looks like Elastic Search is overriding my default mapping values when  
> > it adds defaults dynamically.
> > 
> > I'm seeing ints being stored as longs and floats and double being stored  
> > as string when using  
> > client.admin().indices().create(createRequest)
> > 
> > Dates appear fine.
> > 
> > Here is part of the value used in createRequest.settings(value):  
> > "trxamount":{"type":"double","boost":1}
> > 
> > Here is what I see in the logs:
> > 
> > trxamount":{"type":"string","index\_name":"trxamount","index":"analyzed","store":"no","term\_vector":"no","boost":1.0,"omit\_norms":false,"omit\_term\_freq\_and\_positions":false}
> > 
> > I initially create an index using mappings, I don't provide all the fields  
> > such term\_vector omit\_terms etc, so Elastic Search is dynamically adding  
> > them later when I perform an index.  
> > It looks like it is overriding my mappings.

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 4, 2010, 4:16pm UTC](https://discuss.elastic.co/t/type-storage-issues/3066/4 "2010-07-04T16:16:26Z")

</div>

Perhaps I was using the incorrect api call, I have debug log messages  
enabled for Elastic Search but did not see any problems.

I assume this is the one I want to be using during create? I will try again  
tomorrow.  
public CreateIndexRequest mapping(String type, Map source)

Thanks again for your help.

On Sun, Jul 4, 2010 at 1:50 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Can you explain how you set the mappings in the API? You don't set them  
> through the settings on the createRequest, there is an API to put mappings,  
> or add mappings as part of the API to create an index. If you provide  
> explicit mappings, then elasticsearch should not override what you provided.
> 
> -shay.banon
> 
> On Sat, Jul 3, 2010 at 3:23 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > I created [Type storage issues · Issue #244 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/244for) this.
> > 
> > On Fri, Jul 2, 2010 at 5:19 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > 
> > > It looks like Elastic Search is overriding my default mapping values when  
> > > it adds defaults dynamically.
> > > 
> > > I'm seeing ints being stored as longs and floats and double being stored  
> > > as string when using  
> > > client.admin().indices().create(createRequest)
> > > 
> > > Dates appear fine.
> > > 
> > > Here is part of the value used in createRequest.settings(value):  
> > > "trxamount":{"type":"double","boost":1}
> > > 
> > > Here is what I see in the logs:
> > > 
> > > trxamount":{"type":"string","index\_name":"trxamount","index":"analyzed","store":"no","term\_vector":"no","boost":1.0,"omit\_norms":false,"omit\_term\_freq\_and\_positions":false}
> > > 
> > > I initially create an index using mappings, I don't provide all the  
> > > fields such term\_vector omit\_terms etc, so Elastic Search is dynamically  
> > > adding them later when I perform an index.  
> > > It looks like it is overriding my mappings.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 4, 2010, 5:55pm UTC](https://discuss.elastic.co/t/type-storage-issues/3066/5 "2010-07-04T17:55:54Z")

</div>

Yes, either that one, or you can provide a json string that represents the  
mappings. In any case, the Map is simply a "json" structured maps.

-shay.banon

On Sun, Jul 4, 2010 at 7:16 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com) wrote:

> Perhaps I was using the incorrect api call, I have debug log messages  
> enabled for Elastic Search but did not see any problems.
> 
> I assume this is the one I want to be using during create? I will try again  
> tomorrow.  
> public CreateIndexRequest mapping(String type, Map source)
> 
> Thanks again for your help.
> 
> On Sun, Jul 4, 2010 at 1:50 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Can you explain how you set the mappings in the API? You don't set them  
> > through the settings on the createRequest, there is an API to put mappings,  
> > or add mappings as part of the API to create an index. If you provide  
> > explicit mappings, then elasticsearch should not override what you provided.
> > 
> > -shay.banon
> > 
> > On Sat, Jul 3, 2010 at 3:23 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > 
> > > I created [Type storage issues · Issue #244 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/244for) this.
> > > 
> > > On Fri, Jul 2, 2010 at 5:19 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > 
> > > > It looks like Elastic Search is overriding my default mapping values  
> > > > when it adds defaults dynamically.
> > > > 
> > > > I'm seeing ints being stored as longs and floats and double being stored  
> > > > as string when using  
> > > > client.admin().indices().create(createRequest)
> > > > 
> > > > Dates appear fine.
> > > > 
> > > > Here is part of the value used in createRequest.settings(value):  
> > > > "trxamount":{"type":"double","boost":1}
> > > > 
> > > > Here is what I see in the logs:
> > > > 
> > > > trxamount":{"type":"string","index\_name":"trxamount","index":"analyzed","store":"no","term\_vector":"no","boost":1.0,"omit\_norms":false,"omit\_term\_freq\_and\_positions":false}
> > > > 
> > > > I initially create an index using mappings, I don't provide all the  
> > > > fields such term\_vector omit\_terms etc, so Elastic Search is dynamically  
> > > > adding them later when I perform an index.  
> > > > It looks like it is overriding my mappings.

---

<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, 4:22am UTC](https://discuss.elastic.co/t/type-storage-issues/3066/6 "2017-07-06T04:22:42Z")

</div>


