# Elasticsearch always uses the default mapping

**URL:** https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970
**Category:** Elasticsearch
**Created:** [July 30, 2014, 8:31am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970 "2014-07-30T08:31:03Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Amirah](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Amirah](https://discuss.elastic.co/u/Amirah)
#### Post date: [July 30, 2014, 8:31am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/1 "2014-07-30T08:31:03Z")

</div>

Hello,

Am trying to create an index using "CSV River Plugin for ElasticSearch"  
[https://github.com/AgileWorksOrg/elasticsearch-river-csv](https://github.com/AgileWorksOrg/elasticsearch-river-csv), my csv file  
contains _String_, _long_ and\* date\* values.

My problem is :

- ElasticSearch always consider\* long\* values as _string_ ( with default  
mapping ) and when i try to create a specific mapping to be used, it changes\*  
long\* type to _string_ type.
- So, is there a way to tell ElasticSearch \*Don't map everything as  
string \*?

Any suggestion please?

Thank you

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 30, 2014, 8:46am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/2 "2014-07-30T08:46:58Z")

</div>

I think you are doing something wrong.  
If you defined a mapping it should not be overwritten by the CSV river as far as I know.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 10:31:07, Amirah ([beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com)) a écrit:

Hello,

Am trying to create an index using "CSV River Plugin for ElasticSearch", my csv file contains String, long and date values.

My problem is :

- ElasticSearch always consider long values as string ( with default mapping ) and when i try to create a specific mapping to be used, it changes long type to string type.
- So, is there a way to tell ElasticSearch Don't map everything as string ?

Any suggestion please?

Thank you

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8b102.b03e0c6.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8b102.b03e0c6.f0d0%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Amirah](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Amirah](https://discuss.elastic.co/u/Amirah)
#### Post date: [July 30, 2014, 9:14am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/3 "2014-07-30T09:14:39Z")

</div>

Thanks for the answer,  
Am creating and defining my mapping ( and index) as following :

PUT /newindex/

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}  
PUT /\_river/newindex/\_meta  
{  
"type": "csv",  
"csv\_file": {  
"folder": "E:/elasticsearch-1.2.2/tmp",  
"poll": "5m",  
"first\_line\_is\_header":"true",  
"field\_separator": ";",  
"escape\_character": " ",  
"quote\_character": "'"  
}  
}

and am always getting string in all types ( except date as i put the right  
format in my csv file\* ( 2014-07-24T13:58:25.000Z)\*

any idea ?

On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:

> I think you are doing something wrong.  
> If you defined a mapping it should not be overwritten by the CSV river as  
> far as I know.  
> Enter code here...

> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Hello,
> 
> Am trying to create an index using "CSV River Plugin for Elasticsearch"  
> [https://github.com/AgileWorksOrg/elasticsearch-river-csv](https://github.com/AgileWorksOrg/elasticsearch-river-csv), my csv file  
> contains _String_, _long_ and _date_ values.
> 
> My problem is :
> 
> - Elasticsearch always consider _long_ values as _string_ ( with default  
> mapping ) and when i try to create a specific mapping to be used, it  
> changes _long_ type to _string_ type.
> - So, is there a way to tell Elasticsearch \*Don't map everything as  
> string \*?
> 
> Any suggestion please?
> 
> Thank you
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 30, 2014, 10:34am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/4 "2014-07-30T10:34:16Z")

</div>

This looks strange to me

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}

What is your type name?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 11:14:42, Amirah ([beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com)) a écrit:

Thanks for the answer,  
Am creating and defining my mapping ( and index) as following :

PUT /newindex/

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}  
PUT /\_river/newindex/\_meta  
{  
"type": "csv",  
"csv\_file": {  
"folder": "E:/elasticsearch-1.2.2/tmp",  
"poll": "5m",  
"first\_line\_is\_header":"true",  
"field\_separator": ";",  
"escape\_character": " ",  
"quote\_character": "'"  
}  
}

and am always getting string in all types ( except date as i put the right format in my csv file ( 2014-07-24T13:58:25.000Z)

any idea ?

On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:  
I think you are doing something wrong.  
If you defined a mapping it should not be overwritten by the CSV river as far as I know.  
Enter code here...

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:

Hello,

Am trying to create an index using "CSV River Plugin for ElasticSearch", my csv file contains String, long and date values.

My problem is :

- ElasticSearch always consider long values as string ( with default mapping ) and when i try to create a specific mapping to be used, it changes long type to string type.
- So, is there a way to tell ElasticSearch Don't map everything as string ?

Any suggestion please?

Thank you

## -- 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8ca28.440badfc.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8ca28.440badfc.f0d0%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Amirah](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Amirah](https://discuss.elastic.co/u/Amirah)
#### Post date: [July 30, 2014, 11:54am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/5 "2014-07-30T11:54:49Z")

</div>

there is a missing part ( copy paste error) /\_river/  
So, yes i use this  
PUT /\_river/newindex/\_mapping  
{  
"newindex" : {

```
     "properties": {

```

"MyStringValue": {"type": "string"},  
"MyLongValue": {"type": "long"},  
"MyDateValue":{"type": "date"}  
}  
}  
}

}

to create the mapping, my variables ( type names ) are : _MyStringValue_  
and its type is _String_, _MyLongValue_ and its type is _long_,  
_MyDateValue_ and its type is _date_.  
It creates the mapping ( i already checked using GET \_mapping ) it exists  
with my real types ! but once i use my csv file, it changes to string  
everywhere!

On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:

> This looks strange to me
> 
> PUT /newindex/\_mapping  
> {  
> "newindex" : {
> 
> ```
> "properties": {
> "MyStringValue": {"type": "string"},
> "MyLongValue": {"type": "long"},
> "MyDateValue":{"type": "date"}
> 
> ```
> 
> }  
> }  
> }
> 
> }
> 
> What is your type name?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Thanks for the answer,  
> Am creating and defining my mapping ( and index) as following :
> 
> PUT /newindex/
> 
> PUT /newindex/\_mapping  
> {  
> "newindex" : {
> 
> ```
> "properties": {
> "MyStringValue": {"type": "string"},
> "MyLongValue": {"type": "long"},
> "MyDateValue":{"type": "date"}
> 
> ```
> 
> }  
> }  
> }
> 
> }  
> PUT /\_river/newindex/\_meta  
> {  
> "type": "csv",  
> "csv\_file": {  
> "folder": "E:/elasticsearch-1.2.2/tmp",  
> "poll": "5m",  
> "first\_line\_is\_header":"true",  
> "field\_separator": ";",  
> "escape\_character": " ",  
> "quote\_character": "'"  
> }  
> }
> 
> and am always getting string in all types ( except date as i put the right  
> format in my csv file _( 2014-07-24T13:58:25.000Z)_
> 
> any idea ?
> 
> On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:
> 
> > I think you are doing something wrong.  
> > If you defined a mapping it should not be overwritten by the CSV river  
> > as far as I know.  
> > Enter code here...
> 
> > ```
> > -- 
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > 
> > Hello,
> > 
> > Am trying to create an index using "CSV River Plugin for Elasticsearch"  
> > [https://github.com/AgileWorksOrg/elasticsearch-river-csv](https://github.com/AgileWorksOrg/elasticsearch-river-csv), my csv file  
> > contains _String_, _long_ and _date_ values.
> > 
> > My problem is :
> > 
> > - Elasticsearch always consider _long_ values as _string_ ( with  
> > default mapping ) and when i try to create a specific mapping to be used,  
> > it changes _long_ type to _string_ type.
> > - So, is there a way to tell Elasticsearch \*Don't map everything as  
> > string \*?
> > 
> > Any suggestion please?
> > 
> > Thank you
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 30, 2014, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/6 "2014-07-30T12:06:29Z")

</div>

That's the problem.

A River creates documents in another index than \_river.

If I look at the river documentation, you can set it using:

"index" : {  
"index" : "my\_csv\_data",  
"type" : "csv\_type",  
"bulk\_size" : 100,  
"bulk\_threshold" : 10  
}

So basically, you need to define your aping for index my\_csv\_data and type csv\_type

See [https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request](https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 13:54:53, Amirah ([beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com)) a écrit:

there is a missing part ( copy paste error) /\_river/  
So, yes i use this  
PUT /\_river/newindex/\_mapping  
{  
"newindex" : {

```
     "properties": {

```

"MyStringValue": {"type": "string"},  
"MyLongValue": {"type": "long"},  
"MyDateValue":{"type": "date"}  
}  
}  
}

}

to create the mapping, my variables ( type names ) are : MyStringValue and its type is String, MyLongValue and its type is long, MyDateValue and its type is date.  
It creates the mapping ( i already checked using GET \_mapping ) it exists with my real types ! but once i use my csv file, it changes to string everywhere!

On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:  
This looks strange to me

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}

What is your type name?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:

Thanks for the answer,  
Am creating and defining my mapping ( and index) as following :

PUT /newindex/

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}  
PUT /\_river/newindex/\_meta  
{  
"type": "csv",  
"csv\_file": {  
"folder": "E:/elasticsearch-1.2.2/tmp",  
"poll": "5m",  
"first\_line\_is\_header":"true",  
"field\_separator": ";",  
"escape\_character": " ",  
"quote\_character": "'"  
}  
}

and am always getting string in all types ( except date as i put the right format in my csv file ( 2014-07-24T13:58:25.000Z)

any idea ?

On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:  
I think you are doing something wrong.  
If you defined a mapping it should not be overwritten by the CSV river as far as I know.  
Enter code here...

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:

Hello,

Am trying to create an index using "CSV River Plugin for ElasticSearch", my csv file contains String, long and date values.

My problem is :

- ElasticSearch always consider long values as string ( with default mapping ) and when i try to create a specific mapping to be used, it changes long type to string type.
- So, is there a way to tell ElasticSearch Don't map everything as string ?

Any suggestion please?

Thank you

## -- 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8dfc5.51ead36b.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8dfc5.51ead36b.f0d0%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Amirah](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Amirah](https://discuss.elastic.co/u/Amirah)
#### Post date: [July 30, 2014, 1:57pm UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/7 "2014-07-30T13:57:58Z")

</div>

I don't really see the problem, i selected my newindex ( it exsists in my  
mapping with my types)

PUT /newindex/

PUT /\_river/newindex/\_mapping  
{

```
  "newindex" : {

```

"properties": {  
"marques": {"type": "string"},  
"ventes": {"type": "long"},  
"mois":{"type": "date"}  
}

}  
}  
PUT /\_river/newindex/\_meta  
{  
"type": "csv",  
"csv\_file": {  
"folder": "E:/elasticsearch-1.2.2/tmp",  
"poll": "5m",  
"first\_line\_is\_header":"true",  
"field\_separator": ";",  
"escape\_character": " ",  
"quote\_character": "'"  
}  
,

"index" : {  
"index" : "newindex",  
"type" : "newindex",  
"bulk\_size" : 100,  
"bulk\_threshold" : 10  
}

}

In addition, when i create the newindex it showed {  
"\_index": "\_river",  
"\_type": "newindex",  
"\_id": "\_meta",  
"\_version": 1,  
"created": true  
}  
newindex exists in \_river with correct types

On Wednesday, July 30, 2014 2:06:50 PM UTC+2, David Pilato wrote:

> That's the problem.
> 
> A River creates documents in another index than \_river.
> 
> If I look at the river documentation, you can set it using:
> 
> "index" : {  
> "index" : "my\_csv\_data",  
> "type" : "csv\_type",  
> "bulk\_size" : 100,  
> "bulk\_threshold" : 10  
> }
> 
> So basically, you need to define your aping for index my\_csv\_data and type  
> csv\_type
> 
> See [GitHub - AgileWorksOrg/elasticsearch-river-csv: CSV river for ElasticSearch](https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 13:54:53, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> there is a missing part ( copy paste error) /\_river/  
> So, yes i use this  
> PUT /\_river/newindex/\_mapping  
> {  
> "newindex" : {
> 
> ```
> "properties": {
> "MyStringValue": {"type": "string"},
> "MyLongValue": {"type": "long"},
> "MyDateValue":{"type": "date"}
> 
> ```
> 
> }  
> }  
> }
> 
> }
> 
> to create the mapping, my variables ( type names ) are : _MyStringValue_  
> and its type is _String_, _MyLongValue_ and its type is _long_,  
> _MyDateValue_ and its type is _date_.  
> It creates the mapping ( i already checked using GET \_mapping ) it exists  
> with my real types ! but once i use my csv file, it changes to string  
> everywhere!
> 
> On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:
> 
> > This looks strange to me
> > 
> > PUT /newindex/\_mapping  
> > {  
> > "newindex" : {
> > 
> > ```
> > "properties": {
> > "MyStringValue": {"type": "string"},
> > "MyLongValue": {"type": "long"},
> > "MyDateValue":{"type": "date"}
> > 
> > ```
> > 
> > }  
> > }  
> > }
> > 
> > }
> > 
> > What is your type name?
> > 
> > ```
> > -- 
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > 
> > Thanks for the answer,  
> > Am creating and defining my mapping ( and index) as following :
> > 
> > PUT /newindex/
> > 
> > PUT /newindex/\_mapping  
> > {  
> > "newindex" : {
> > 
> > ```
> > "properties": {
> > "MyStringValue": {"type": "string"},
> > "MyLongValue": {"type": "long"},
> > "MyDateValue":{"type": "date"}
> > 
> > ```
> > 
> > }  
> > }  
> > }
> > 
> > }  
> > PUT /\_river/newindex/\_meta  
> > {  
> > "type": "csv",  
> > "csv\_file": {  
> > "folder": "E:/elasticsearch-1.2.2/tmp",  
> > "poll": "5m",  
> > "first\_line\_is\_header":"true",  
> > "field\_separator": ";",  
> > "escape\_character": " ",  
> > "quote\_character": "'"  
> > }  
> > }
> > 
> > and am always getting string in all types ( except date as i put the  
> > right format in my csv file _( 2014-07-24T13:58:25.000Z)_
> > 
> > any idea ?
> > 
> > On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:
> > 
> > > I think you are doing something wrong.  
> > > If you defined a mapping it should not be overwritten by the CSV river  
> > > as far as I know.  
> > > Enter code here...
> > 
> > > ```
> > > -- 
> > > 
> > > ```
> > > 
> > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > 
> > > Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > > 
> > > Hello,
> > > 
> > > Am trying to create an index using "CSV River Plugin for Elasticsearch"  
> > > [https://github.com/AgileWorksOrg/elasticsearch-river-csv](https://github.com/AgileWorksOrg/elasticsearch-river-csv), my csv file  
> > > contains _String_, _long_ and _date_ values.
> > > 
> > > My problem is :
> > > 
> > > - Elasticsearch always consider _long_ values as _string_ ( with  
> > > default mapping ) and when i try to create a specific mapping to be used,  
> > > it changes _long_ type to _string_ type.
> > > - So, is there a way to tell Elasticsearch \*Don't map everything as  
> > > string \*?
> > > 
> > > Any suggestion please?
> > > 
> > > Thank you
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 30, 2014, 2:03pm UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/8 "2014-07-30T14:03:59Z")

</div>

You applied a mapping to index \_river and type newindex.

This is not what I said. You need to apply your mapping to newindex index and newindex type.

Basically something like:  
PUT /newindex/

PUT /newindex/newindex/\_mapping  
{

```
  "newindex" : {

```

"properties": {  
"marques": {"type": "string"},  
"ventes": {"type": "long"},  
"mois":{"type": "date"}  
}

}  
}

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 15:58:02, Amirah ([beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com)) a écrit:

I don't really see the problem, i selected my newindex ( it exsists in my mapping with my types)

PUT /newindex/

PUT /\_river/newindex/\_mapping  
{

```
  "newindex" : {

```

"properties": {  
"marques": {"type": "string"},  
"ventes": {"type": "long"},  
"mois":{"type": "date"}  
}

}  
}  
PUT /\_river/newindex/\_meta  
{  
"type": "csv",  
"csv\_file": {  
"folder": "E:/elasticsearch-1.2.2/tmp",  
"poll": "5m",  
"first\_line\_is\_header":"true",  
"field\_separator": ";",  
"escape\_character": " ",  
"quote\_character": "'"  
}  
,

"index" : {  
"index" : "newindex",  
"type" : "newindex",  
"bulk\_size" : 100,  
"bulk\_threshold" : 10  
}

}

In addition, when i create the newindex it showed {  
"\_index": "\_river",  
"\_type": "newindex",  
"\_id": "\_meta",  
"\_version": 1,  
"created": true  
}  
newindex exists in \_river with correct types

On Wednesday, July 30, 2014 2:06:50 PM UTC+2, David Pilato wrote:  
That's the problem.

A River creates documents in another index than \_river.

If I look at the river documentation, you can set it using:

"index" : {  
"index" : "my\_csv\_data",  
"type" : "csv\_type",  
"bulk\_size" : 100,  
"bulk\_threshold" : 10  
}

So basically, you need to define your aping for index my\_csv\_data and type csv\_type

See [https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request](https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 13:54:53, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:

there is a missing part ( copy paste error) /\_river/  
So, yes i use this  
PUT /\_river/newindex/\_mapping  
{  
"newindex" : {

```
     "properties": {

```

"MyStringValue": {"type": "string"},  
"MyLongValue": {"type": "long"},  
"MyDateValue":{"type": "date"}  
}  
}  
}

}

to create the mapping, my variables ( type names ) are : MyStringValue and its type is String, MyLongValue and its type is long, MyDateValue and its type is date.  
It creates the mapping ( i already checked using GET \_mapping ) it exists with my real types ! but once i use my csv file, it changes to string everywhere!

On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:  
This looks strange to me

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}

What is your type name?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:

Thanks for the answer,  
Am creating and defining my mapping ( and index) as following :

PUT /newindex/

PUT /newindex/\_mapping  
{  
"newindex" : {

```
      "properties": {
"MyStringValue": {"type": "string"},
"MyLongValue": {"type": "long"},
"MyDateValue":{"type": "date"}

```

}  
}  
}

}  
PUT /\_river/newindex/\_meta  
{  
"type": "csv",  
"csv\_file": {  
"folder": "E:/elasticsearch-1.2.2/tmp",  
"poll": "5m",  
"first\_line\_is\_header":"true",  
"field\_separator": ";",  
"escape\_character": " ",  
"quote\_character": "'"  
}  
}

and am always getting string in all types ( except date as i put the right format in my csv file ( 2014-07-24T13:58:25.000Z)

any idea ?

On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:  
I think you are doing something wrong.  
If you defined a mapping it should not be overwritten by the CSV river as far as I know.  
Enter code here...

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:

Hello,

Am trying to create an index using "CSV River Plugin for ElasticSearch", my csv file contains String, long and date values.

My problem is :

- ElasticSearch always consider long values as string ( with default mapping ) and when i try to create a specific mapping to be used, it changes long type to string type.
- So, is there a way to tell ElasticSearch Don't map everything as string ?

Any suggestion please?

Thank you

## -- 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Amirah](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Amirah](https://discuss.elastic.co/u/Amirah)
#### Post date: [July 30, 2014, 2:08pm UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/9 "2014-07-30T14:08:25Z")

</div>

ah, yes, i didn't specify the type, thank you so much for your help

On 30 July 2014 16:03, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> You applied a mapping to index \_river and type newindex.
> 
> This is not what I said. You need to apply your mapping to newindex index  
> and newindex type.
> 
> Basically something like:  
> PUT /newindex/
> 
> PUT /newindex/newindex/\_mapping  
> {
> 
> ```
> "newindex" : {
> 
> ```
> 
> "properties": {  
> "marques": {"type": "string"},  
> "ventes": {"type": "long"},  
> "mois":{"type": "date"}  
> }
> 
> }  
> }
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 15:58:02, Amirah ([beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com)) a écrit:
> 
> I don't really see the problem, i selected my newindex ( it exsists in my  
> mapping with my types)
> 
> PUT /newindex/
> 
> PUT /\_river/newindex/\_mapping  
> {
> 
> ```
> "newindex" : {
> "properties": {
> "marques": {"type": "string"},
> "ventes": {"type": "long"},
> "mois":{"type": "date"}
> 
> ```
> 
> }
> 
> }  
> }  
> PUT /\_river/newindex/\_meta  
> {  
> "type": "csv",  
> "csv\_file": {  
> "folder": "E:/elasticsearch-1.2.2/tmp",  
> "poll": "5m",  
> "first\_line\_is\_header":"true",  
> "field\_separator": ";",  
> "escape\_character": " ",  
> "quote\_character": "'"  
> }  
> ,
> 
> "index" : {  
> "index" : "newindex",  
> "type" : "newindex",  
> "bulk\_size" : 100,  
> "bulk\_threshold" : 10  
> }
> 
> }
> 
> In addition, when i create the newindex it showed {  
> "\_index": "\_river",  
> "\_type": "newindex",  
> "\_id": "\_meta",  
> "\_version": 1,  
> "created": true  
> }  
> newindex exists in \_river with correct types
> 
> On Wednesday, July 30, 2014 2:06:50 PM UTC+2, David Pilato wrote:
> 
> > That's the problem.
> > 
> > A River creates documents in another index than \_river.
> > 
> > If I look at the river documentation, you can set it using:
> > 
> > "index" : {  
> > "index" : "my\_csv\_data",  
> > "type" : "csv\_type",  
> > "bulk\_size" : 100,  
> > "bulk\_threshold" : 10  
> > }
> > 
> > So basically, you need to define your aping for index my\_csv\_data and  
> > type csv\_type
> > 
> > See [GitHub - AgileWorksOrg/elasticsearch-river-csv: CSV river for ElasticSearch](https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request)
> > 
> > ```
> > --
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 30 juillet 2014 à 13:54:53, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > 
> > there is a missing part ( copy paste error) /\_river/  
> > So, yes i use this  
> > PUT /\_river/newindex/\_mapping  
> > {  
> > "newindex" : {
> > 
> > ```
> > "properties": {
> > "MyStringValue": {"type": "string"},
> > "MyLongValue": {"type": "long"},
> > "MyDateValue":{"type": "date"}
> > 
> > ```
> > 
> > }  
> > }  
> > }
> > 
> > }
> > 
> > to create the mapping, my variables ( type names ) are : _MyStringValue_  
> > and its type is _String_, _MyLongValue_ and its type is _long_,  
> > _MyDateValue_ and its type is _date_.  
> > It creates the mapping ( i already checked using GET \_mapping ) it exists  
> > with my real types ! but once i use my csv file, it changes to string  
> > everywhere!
> > 
> > On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:
> > 
> > > This looks strange to me
> > > 
> > > PUT /newindex/\_mapping  
> > > {  
> > > "newindex" : {
> > > 
> > > ```
> > > "properties": {
> > > "MyStringValue": {"type": "string"},
> > > "MyLongValue": {"type": "long"},
> > > "MyDateValue":{"type": "date"}
> > > 
> > > ```
> > > 
> > > }  
> > > }  
> > > }
> > > 
> > > }
> > > 
> > > What is your type name?
> > > 
> > > ```
> > > --
> > > 
> > > ```
> > > 
> > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > 
> > > Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > > 
> > > Thanks for the answer,  
> > > Am creating and defining my mapping ( and index) as following :
> > > 
> > > PUT /newindex/
> > > 
> > > PUT /newindex/\_mapping  
> > > {  
> > > "newindex" : {
> > > 
> > > ```
> > > "properties": {
> > > "MyStringValue": {"type": "string"},
> > > "MyLongValue": {"type": "long"},
> > > "MyDateValue":{"type": "date"}
> > > 
> > > ```
> > > 
> > > }  
> > > }  
> > > }
> > > 
> > > }  
> > > PUT /\_river/newindex/\_meta  
> > > {  
> > > "type": "csv",  
> > > "csv\_file": {  
> > > "folder": "E:/elasticsearch-1.2.2/tmp",  
> > > "poll": "5m",  
> > > "first\_line\_is\_header":"true",  
> > > "field\_separator": ";",  
> > > "escape\_character": " ",  
> > > "quote\_character": "'"  
> > > }  
> > > }
> > > 
> > > and am always getting string in all types ( except date as i put the  
> > > right format in my csv file _( 2014-07-24T13:58:25.000Z)_
> > > 
> > > any idea ?
> > > 
> > > On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:
> > > 
> > > > I think you are doing something wrong.  
> > > > If you defined a mapping it should not be overwritten by the CSV  
> > > > river as far as I know.  
> > > > Enter code here...
> > > 
> > > > ```
> > > > --
> > > > 
> > > > ```
> > > > 
> > > > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > > > 
> > > > Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > > > 
> > > > Hello,
> > > > 
> > > > Am trying to create an index using "CSV River Plugin for Elasticsearch"  
> > > > [https://github.com/AgileWorksOrg/elasticsearch-river-csv](https://github.com/AgileWorksOrg/elasticsearch-river-csv), my csv  
> > > > file contains _String_, _long_ and _date_ values.
> > > > 
> > > > My problem is :
> > > > 
> > > > - Elasticsearch always consider _long_ values as _string_ ( with  
> > > > default mapping ) and when i try to create a specific mapping to be used,  
> > > > it changes _long_ type to _string_ type.
> > > > - So, is there a way to tell Elasticsearch \*Don't map everything as  
> > > > string \*?
> > > > 
> > > > Any suggestion please?
> > > > 
> > > > Thank you
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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).
> 
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/7kSOrYA9k-I/unsubscribe](https://groups.google.com/d/topic/elasticsearch/7kSOrYA9k-I/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local)  
> [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAP4YzSeOQAmZsmpZNXGc8PqcvnBWmwoO3k1NkQ7YUUNk%2Bdg\_jw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAP4YzSeOQAmZsmpZNXGc8PqcvnBWmwoO3k1NkQ7YUUNk%2Bdg_jw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Amirah](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Amirah](https://discuss.elastic.co/u/Amirah)
#### Post date: [July 30, 2014, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/10 "2014-07-30T14:09:19Z")

</div>

ah, yes, i didn't specify the type, thank you so much for your help

On Wednesday, July 30, 2014 4:04:18 PM UTC+2, David Pilato wrote:

> You applied a mapping to index \_river and type newindex.
> 
> This is not what I said. You need to apply your mapping to newindex index  
> and newindex type.
> 
> Basically something like:  
> PUT /newindex/
> 
> PUT /newindex/newindex/\_mapping  
> {
> 
> ```
> "newindex" : {
> 
> ```
> 
> "properties": {  
> "marques": {"type": "string"},  
> "ventes": {"type": "long"},  
> "mois":{"type": "date"}  
> }
> 
> }  
> }
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 15:58:02, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> I don't really see the problem, i selected my newindex ( it exsists in my  
> mapping with my types)
> 
> PUT /newindex/
> 
> PUT /\_river/newindex/\_mapping  
> {
> 
> ```
> "newindex" : {
> "properties": {
> "marques": {"type": "string"},
> "ventes": {"type": "long"},
> "mois":{"type": "date"}
> 
> ```
> 
> }
> 
> }  
> }  
> PUT /\_river/newindex/\_meta  
> {  
> "type": "csv",  
> "csv\_file": {  
> "folder": "E:/elasticsearch-1.2.2/tmp",  
> "poll": "5m",  
> "first\_line\_is\_header":"true",  
> "field\_separator": ";",  
> "escape\_character": " ",  
> "quote\_character": "'"  
> }  
> ,
> 
> "index" : {  
> "index" : "newindex",  
> "type" : "newindex",  
> "bulk\_size" : 100,  
> "bulk\_threshold" : 10  
> }
> 
> }
> 
> In addition, when i create the newindex it showed {  
> "\_index": "\_river",  
> "\_type": "newindex",  
> "\_id": "\_meta",  
> "\_version": 1,  
> "created": true  
> }  
> newindex exists in \_river with correct types
> 
> On Wednesday, July 30, 2014 2:06:50 PM UTC+2, David Pilato wrote:
> 
> That's the problem.
> 
> A River creates documents in another index than \_river.
> 
> If I look at the river documentation, you can set it using:
> 
> "index" : {  
> "index" : "my\_csv\_data",  
> "type" : "csv\_type",  
> "bulk\_size" : 100,  
> "bulk\_threshold" : 10  
> }
> 
> So basically, you need to define your aping for index my\_csv\_data and type  
> csv\_type
> 
> See [GitHub - AgileWorksOrg/elasticsearch-river-csv: CSV river for ElasticSearch](https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request)
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 13:54:53, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> 
> there is a missing part ( copy paste error) /\_river/  
> So, yes i use this  
> PUT /\_river/newindex/\_mapping  
> {  
> "newindex" : {
> 
> ```
> "properties": {
> "MyStringValue": {"type": "string"},
> "MyLongValue": {"type": "long"},
> "MyDateValue":{"type": "date"}
> 
> ```
> 
> }  
> }  
> }
> 
> }
> 
> to create the mapping, my variables ( type names ) are : _MyStringValue_  
> and its type is _String_, _MyLongValue_ and its type is _long_,  
> _MyDateValue_ and its type is _date_.  
> It creates the mapping ( i already checked using GET \_mapping ) it exists  
> with my real types ! but once i use my csv file, it changes to string  
> everywhere!
> 
> On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:
> 
> This looks strange to me
> 
> PUT /newindex/\_mapping  
> {  
> "newindex" : {
> 
> ```
> "properties": {
> "MyStringValue": {"type": "string"},
> "MyLongValue": {"type": "long"},
> "MyDateValue":{"type": "date"}
> 
> ```
> 
> }  
> }  
> }
> 
> }
> 
> What is your type name?
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> 
> Thanks for the answer,  
> Am creating and defining my mapping ( and index) as following :
> 
> PUT /newindex/
> 
> PUT /newindex/\_mapping  
> {  
> "newindex" : {
> 
> ```
> "properties": {
> "MyStringValue": {"type": "string"},
> "MyLongValue": {"type": "long"},
> "MyDateValue":{"type": "date"}
> 
> ```
> 
> }  
> }  
> }
> 
> }  
> PUT /\_river/newindex/\_meta  
> {  
> "type": "csv",  
> "csv\_file": {  
> "folder": "E:/elasticsearch-1.2.2/tmp",  
> "poll": "5m",  
> "first\_line\_is\_header":"true",  
> "field\_separator": ";",  
> "escape\_character": " ",  
> "quote\_character": "'"  
> }  
> }
> 
> and am always getting string in all types ( except date as i put the right  
> format in my csv file _( 2014-07-24T13:58:25.000Z)_
> 
> any idea ?
> 
> On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:
> 
> I think you are doing something wrong.  
> If you defined a mapping it should not be overwritten by the CSV river  
> as far as I know.  
> Enter code here...
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> 
> Hello,
> 
> Am trying to create an index using \<a href="  
> [GitHub - AgileWorksOrg/elasticsearch-river-csv: CSV river for ElasticSearch](https://github.com/AgileWorksOrg/elasticsearch-river-csv)" target="\_blank"  
> onmousedown="this.href='  
> [Redirect Notice](https://www.google.com/url?q%5C75https%3A%2F%2Fgithub.com%2FAgileWorksOrg%2Felasticsearch-river-csv%5C46sa%5C75D%5C46sntz%5C0751%5C46usg%5C75AFQjCNH-Oe_D3bdqo29taqZGFO2dQOrMWw)';return  
> [https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2FAgileWorksOrg%2Felasticsearch-river-csv\46sa\75D\46sntz\0751\46usg\75AFQjCNH-Oe\_D3bdqo29taqZGFO2dQOrMWw';return](https://www.google.com/url?q%5C75https%3A%2F%2Fgithub.com%2FAgileWorksOrg%2Felasticsearch-river-csv%5C46sa%5C75D%5C46sntz%5C0751%5C46usg%5C75AFQjCNH-Oe_D3bdqo29taqZGFO2dQOrMWw';return)  
> true;" onclick="this.href='  
> [Redirect Notice](https://www.google.com/url?q%5C75https%3A%2F%2Fgithub.com%2FAgileWorksOrg%2Felastic)  
> [https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2FAgileWorksOrg%2Felastic](https://www.google.com/url?q%5C75https%3A%2F%2Fgithub.com%2FAgileWorksOrg%2Felastic)
> 
> ...

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d614b226-385d-4fd9-b0c7-a753553d6f8e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d614b226-385d-4fd9-b0c7-a753553d6f8e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 30, 2014, 6:26pm UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/11 "2014-07-30T18:26:24Z")

</div>

You did specify the type. But you sent the put mapping request in the wrong index.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 30 juil. 2014 à 16:08, Amira BELDJILALI [beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com) a écrit :
> 
> ah, yes, i didn't specify the type, thank you so much for your help
> 
> > On 30 July 2014 16:03, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> > You applied a mapping to index \_river and type newindex.
> > 
> > This is not what I said. You need to apply your mapping to newindex index and newindex type.
> > 
> > Basically something like:  
> > PUT /newindex/
> > 
> > PUT /newindex/newindex/\_mapping  
> > {
> > 
> > ```
> > "newindex" : {
> > 
> > ```
> > 
> > "properties": {  
> > "marques": {"type": "string"},  
> > "ventes": {"type": "long"},  
> > "mois":{"type": "date"}  
> > }
> > 
> > }  
> > }
> > 
> > --  
> > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > @dadoonet | @elasticsearchfr
> > 
> > > Le 30 juillet 2014 à 15:58:02, Amirah ([beldjilali.a@gmail.com](mailto:beldjilali.a@gmail.com)) a écrit:
> > > 
> > > I don't really see the problem, i selected my newindex ( it exsists in my mapping with my types)
> > > 
> > > PUT /newindex/
> > > 
> > > PUT /\_river/newindex/\_mapping  
> > > {
> > > 
> > > ```
> > > "newindex" : {
> > > 
> > > ```
> > > 
> > > "properties": {  
> > > "marques": {"type": "string"},  
> > > "ventes": {"type": "long"},  
> > > "mois":{"type": "date"}  
> > > }
> > > 
> > > }  
> > > }  
> > > PUT /\_river/newindex/\_meta  
> > > {  
> > > "type": "csv",  
> > > "csv\_file": {  
> > > "folder": "E:/elasticsearch-1.2.2/tmp",  
> > > "poll": "5m",  
> > > "first\_line\_is\_header":"true",  
> > > "field\_separator": ";",  
> > > "escape\_character": " ",  
> > > "quote\_character": "'"  
> > > }  
> > > ,
> > > 
> > > "index" : {  
> > > "index" : "newindex",  
> > > "type" : "newindex",  
> > > "bulk\_size" : 100,  
> > > "bulk\_threshold" : 10  
> > > }
> > > 
> > > }
> > > 
> > > In addition, when i create the newindex it showed {  
> > > "\_index": "\_river",  
> > > "\_type": "newindex",  
> > > "\_id": "\_meta",  
> > > "\_version": 1,  
> > > "created": true  
> > > }  
> > > newindex exists in \_river with correct types
> > > 
> > > > On Wednesday, July 30, 2014 2:06:50 PM UTC+2, David Pilato wrote:  
> > > > That's the problem.
> > > > 
> > > > A River creates documents in another index than \_river.
> > > > 
> > > > If I look at the river documentation, you can set it using:
> > > > 
> > > > "index" : {  
> > > > "index" : "my\_csv\_data",  
> > > > "type" : "csv\_type",  
> > > > "bulk\_size" : 100,  
> > > > "bulk\_threshold" : 10  
> > > > }
> > > > 
> > > > So basically, you need to define your aping for index my\_csv\_data and type csv\_type
> > > > 
> > > > See [GitHub - AgileWorksOrg/elasticsearch-river-csv: CSV river for ElasticSearch](https://github.com/AgileWorksOrg/elasticsearch-river-csv#full-request)
> > > > 
> > > > --  
> > > > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > > > @dadoonet | @elasticsearchfr
> > > > 
> > > > > Le 30 juillet 2014 à 13:54:53, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > > > > 
> > > > > there is a missing part ( copy paste error) /\_river/  
> > > > > So, yes i use this  
> > > > > PUT /\_river/newindex/\_mapping  
> > > > > {  
> > > > > "newindex" : {
> > > > > 
> > > > > ```
> > > > > "properties": {
> > > > > 
> > > > > ```
> > > > > 
> > > > > "MyStringValue": {"type": "string"},  
> > > > > "MyLongValue": {"type": "long"},  
> > > > > "MyDateValue":{"type": "date"}  
> > > > > }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > }
> > > > > 
> > > > > to create the mapping, my variables ( type names ) are : MyStringValue and its type is String, MyLongValue and its type is long, MyDateValue and its type is date.  
> > > > > It creates the mapping ( i already checked using GET \_mapping ) it exists with my real types ! but once i use my csv file, it changes to string everywhere!
> > > > > 
> > > > > > On Wednesday, July 30, 2014 12:34:25 PM UTC+2, David Pilato wrote:  
> > > > > > This looks strange to me
> > > > > > 
> > > > > > PUT /newindex/\_mapping  
> > > > > > {  
> > > > > > "newindex" : {
> > > > > > 
> > > > > > ```
> > > > > > "properties": {
> > > > > > "MyStringValue": {"type": "string"},
> > > > > > "MyLongValue": {"type": "long"},
> > > > > > "MyDateValue":{"type": "date"}
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > }  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > }
> > > > > > 
> > > > > > What is your type name?
> > > > > > 
> > > > > > --  
> > > > > > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > > > > > @dadoonet | @elasticsearchfr
> > > > > > 
> > > > > > > Le 30 juillet 2014 à 11:14:42, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > > > > > > 
> > > > > > > Thanks for the answer,  
> > > > > > > Am creating and defining my mapping ( and index) as following :
> > > > > > > 
> > > > > > > PUT /newindex/
> > > > > > > 
> > > > > > > PUT /newindex/\_mapping  
> > > > > > > {  
> > > > > > > "newindex" : {
> > > > > > > 
> > > > > > > ```
> > > > > > > "properties": {
> > > > > > > "MyStringValue": {"type": "string"},
> > > > > > > "MyLongValue": {"type": "long"},
> > > > > > > "MyDateValue":{"type": "date"}
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > }  
> > > > > > > }  
> > > > > > > }
> > > > > > > 
> > > > > > > }  
> > > > > > > PUT /\_river/newindex/\_meta  
> > > > > > > {  
> > > > > > > "type": "csv",  
> > > > > > > "csv\_file": {  
> > > > > > > "folder": "E:/elasticsearch-1.2.2/tmp",  
> > > > > > > "poll": "5m",  
> > > > > > > "first\_line\_is\_header":"true",  
> > > > > > > "field\_separator": ";",  
> > > > > > > "escape\_character": " ",  
> > > > > > > "quote\_character": "'"  
> > > > > > > }  
> > > > > > > }
> > > > > > > 
> > > > > > > and am always getting string in all types ( except date as i put the right format in my csv file ( 2014-07-24T13:58:25.000Z)
> > > > > > > 
> > > > > > > any idea ?
> > > > > > > 
> > > > > > > > On Wednesday, July 30, 2014 10:47:13 AM UTC+2, David Pilato wrote:  
> > > > > > > > I think you are doing something wrong.  
> > > > > > > > If you defined a mapping it should not be overwritten by the CSV river as far as I know.  
> > > > > > > > Enter code here...
> > > > > > > 
> > > > > > > > --  
> > > > > > > > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > > > > > > > @dadoonet | @elasticsearchfr
> > > > > > > > 
> > > > > > > > > Le 30 juillet 2014 à 10:31:07, Amirah ([beldji...@gmail.com](mailto:beldji...@gmail.com)) a écrit:
> > > > > > > > > 
> > > > > > > > > Hello,
> > > > > > > > > 
> > > > > > > > > Am trying to create an index using "CSV River Plugin for Elasticsearch", my csv file contains String, long and date values.
> > > > > > > > > 
> > > > > > > > > My problem is :
> > > > > > > > > 
> > > > > > > > > - Elasticsearch always consider long values as string ( with default mapping ) and when i try to create a specific mapping to be used, it changes long type to string type.
> > > > > > > > > - So, is there a way to tell Elasticsearch Don't map everything as string ?
> > > > > > > > > 
> > > > > > > > > Any suggestion please?
> > > > > > > > > 
> > > > > > > > > Thank you
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/664de1fc-1e52-4846-9660-5f5808d7b6af%40googlegroups.com).  
> > > > > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).  
> > > > > > > > > --  
> > > > > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/69675304-f587-4ad2-b24c-550be4446039%40googlegroups.com).  
> > > > > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).  
> > > > > > > > > --  
> > > > > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8a17a8f-a98e-41fa-a774-36cdc0f4b684%40googlegroups.com).  
> > > > > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).  
> > > > > > > > > --  
> > > > > > > > > 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).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1db22392-4c77-49ca-97d9-f669d47da861%40googlegroups.com).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/7kSOrYA9k-I/unsubscribe](https://groups.google.com/d/topic/elasticsearch/7kSOrYA9k-I/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8fb4f.6a2342ec.f0d0%40MacBook-Air-de-David.local).
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAP4YzSeOQAmZsmpZNXGc8PqcvnBWmwoO3k1NkQ7YUUNk%2Bdg\_jw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAP4YzSeOQAmZsmpZNXGc8PqcvnBWmwoO3k1NkQ7YUUNk%2Bdg_jw%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/84DF0B99-5284-47D1-B4A7-B606FA4D93C9%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/84DF0B99-5284-47D1-B4A7-B606FA4D93C9%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:12am UTC](https://discuss.elastic.co/t/elasticsearch-always-uses-the-default-mapping/18970/12 "2017-07-06T01:12:09Z")

</div>


