# Es mapping problem

**URL:** https://discuss.elastic.co/t/es-mapping-problem/10652
**Category:** Elasticsearch
**Created:** [February 7, 2013, 2:43pm UTC](https://discuss.elastic.co/t/es-mapping-problem/10652 "2013-02-07T14:43:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![andrea\_crotti](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@andrea\_crotti](https://discuss.elastic.co/u/andrea_crotti)
#### Post date: [February 7, 2013, 2:43pm UTC](https://discuss.elastic.co/t/es-mapping-problem/10652/1 "2013-02-07T14:43:50Z")

</div>

I copied and slightly modified the example from the official doc, but this  
fails:

$ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
-d '{  
"created\_datetime" : {  
"properties" : {  
"created\_datetime" : {"type" : "string"},  
}  
}  
}'

Why this error?  
{"error":"MapperParsingException[Failed to parse mapping definition];  
nested: JsonParseException[Unexpected character ('}' (code 125)): was  
expecting either valid name character (for unquoted name) or double-quote  
(for quoted) to start field name\n at [Source: {\n "created\_datetime"  
: {\n "properties" : {\n "created\_datetime" :  
{"type" : "string"},\n }\n }\n}; line: 5, column: 10]];  
","status":400}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)
#### Post date: [February 7, 2013, 2:46pm UTC](https://discuss.elastic.co/t/es-mapping-problem/10652/2 "2013-02-07T14:46:44Z")

</div>

Hello!

Try removing the comma character after "created\_datetime" : {"type" : "string"},", so your command looks like this:

$ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)' -d '{

"created\_datetime" : {

```
"properties" : {

 "created_datetime" : {"type" : "string"}

}

```

}

}'

_--_

Regards,

Rafał Kuć

Sematext :: [http://sematext.com/](http://sematext.com/) _:: Solr - Lucene - Nutch - ElasticSearch_

I copied and slightly modified the example from the official doc, but this fails:

$ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)' -d '{

```
"created_datetime" : {

    "properties" : {

        "created_datetime" : {"type" : "string"},

    }

}

```

}'

Why this error?

{"error":"MapperParsingException[Failed to parse mapping definition]; nested: JsonParseException[Unexpected character ('}' (code 125)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: {\n "created\_datetime" : {\n "properties" : {\n "created\_datetime" : {"type" : "string"},\n }\n }\n}; line: 5, column: 10]]; ","status":400}

--

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).

For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![andrea\_crotti](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@andrea\_crotti](https://discuss.elastic.co/u/andrea_crotti)
#### Post date: [February 7, 2013, 3:07pm UTC](https://discuss.elastic.co/t/es-mapping-problem/10652/3 "2013-02-07T15:07:16Z")

</div>

Thanks that was it.  
Unfortunately I still don't see all the results that I should see..  
If I got some errors previously because of malformed dates and I update the  
mappings, should I immediately see the results which didn't come up before?

Or is it anything else?

On Thursday, February 7, 2013 2:46:44 PM UTC, Rafał Kuć wrote:

> Hello!
> 
> Try removing the comma character after "created\_datetime" : {"type" :  
> "string"},", so your command looks like this:
> 
> $ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
> -d '{  
> "created\_datetime" : {  
> "properties" : {  
> "created\_datetime" : {"type" : "string"}  
> }  
> }  
> }'
> 
> \*--  
> Regards,  
> Rafał Kuć  
> Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> Elasticsearch
> 
> - 
> 
> I copied and slightly modified the example from the official doc, but  
> this fails:
> 
> $ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
> -d '{  
> "created\_datetime" : {  
> "properties" : {  
> "created\_datetime" : {"type" : "string"},  
> }  
> }  
> }'
> 
> ## Why this error? {"error":"MapperParsingException[Failed to parse mapping definition]; nested: JsonParseException[Unexpected character ('}' (code 125)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: {\n "created\_datetime" : {\n "properties" : {\n "created\_datetime" : {"type" : "string"},\n }\n }\n}; line: 5, column: 10]]; ","status":400}
> 
> 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:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![andrea\_crotti](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@andrea\_crotti](https://discuss.elastic.co/u/andrea_crotti)
#### Post date: [February 7, 2013, 3:31pm UTC](https://discuss.elastic.co/t/es-mapping-problem/10652/4 "2013-02-07T15:31:28Z")

</div>

So what happens if I have multiple mappings for the same thing?  
Should the last take precedence or not?

I have other created\_datetime mappings for the same index, which are  
automatically created by the river and I don't want, how can I just stop  
creating them or removing them?

On Thursday, February 7, 2013 3:07:16 PM UTC, andrea crotti wrote:

> Thanks that was it.  
> Unfortunately I still don't see all the results that I should see..  
> If I got some errors previously because of malformed dates and I update  
> the mappings, should I immediately see the results which didn't come up  
> before?
> 
> Or is it anything else?
> 
> On Thursday, February 7, 2013 2:46:44 PM UTC, Rafał Kuć wrote:
> 
> > Hello!
> > 
> > Try removing the comma character after "created\_datetime" : {"type" :  
> > "string"},", so your command looks like this:
> > 
> > $ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
> > -d '{  
> > "created\_datetime" : {  
> > "properties" : {  
> > "created\_datetime" : {"type" : "string"}  
> > }  
> > }  
> > }'
> > 
> > \*--  
> > Regards,  
> > Rafał Kuć  
> > Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> > Elasticsearch
> > 
> > - 
> > 
> > I copied and slightly modified the example from the official doc, but  
> > this fails:
> > 
> > $ curl -XPUT '[http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
> > -d '{  
> > "created\_datetime" : {  
> > "properties" : {  
> > "created\_datetime" : {"type" : "string"},  
> > }  
> > }  
> > }'
> > 
> > ## Why this error? {"error":"MapperParsingException[Failed to parse mapping definition]; nested: JsonParseException[Unexpected character ('}' (code 125)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: {\n "created\_datetime" : {\n "properties" : {\n "created\_datetime" : {"type" : "string"},\n }\n }\n}; line: 5, column: 10]]; ","status":400}
> > 
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [February 7, 2013, 7:01pm UTC](https://discuss.elastic.co/t/es-mapping-problem/10652/5 "2013-02-07T19:01:50Z")

</div>

You cannot the type of a field once it has been indexed, so there is no  
notion of precedence. If you are using a river, it is best to create the  
index first with the correct mapping before creating the river.

--  
Ivan

On Thu, Feb 7, 2013 at 7:31 AM, andrea crotti [andrea.crotti.0@gmail.com](mailto:andrea.crotti.0@gmail.com)wrote:

> So what happens if I have multiple mappings for the same thing?  
> Should the last take precedence or not?
> 
> I have other created\_datetime mappings for the same index, which are  
> automatically created by the river and I don't want, how can I just stop  
> creating them or removing them?
> 
> On Thursday, February 7, 2013 3:07:16 PM UTC, andrea crotti wrote:
> 
> > Thanks that was it.  
> > Unfortunately I still don't see all the results that I should see..  
> > If I got some errors previously because of malformed dates and I update  
> > the mappings, should I immediately see the results which didn't come up  
> > before?
> > 
> > Or is it anything else?
> > 
> > On Thursday, February 7, 2013 2:46:44 PM UTC, Rafał Kuć wrote:
> > 
> > > Hello!
> > > 
> > > Try removing the comma character after "created\_datetime" : {"type" :  
> > > "string"},", so your command looks like this:
> > > 
> > > $ curl -XPUT '[http://localhost:9200/wk-\*\*beta-com/created\_datetime/\_](http://localhost:9200/wk-**beta-com/created_datetime/_)\*\*  
> > > mapping [http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
> > > -d '{  
> > > "created\_datetime" : {  
> > > "properties" : {  
> > > "created\_datetime" : {"type" : "string"}  
> > > }  
> > > }  
> > > }'
> > > 
> > > \*--  
> > > Regards,  
> > > Rafał Kuć  
> > > Sematext :: _[http://sematext.com/](http://sematext.com/)_ :: Solr - Lucene - Nutch -  
> > > Elasticsearch
> > > 
> > > - 
> > > 
> > > I copied and slightly modified the example from the official doc, but  
> > > this fails:
> > > 
> > > $ curl -XPUT '[http://localhost:9200/wk-\*\*beta-com/created\_datetime/\_](http://localhost:9200/wk-**beta-com/created_datetime/_)\*\*  
> > > mapping [http://localhost:9200/wk-beta-com/created\_datetime/\_mapping](http://localhost:9200/wk-beta-com/created_datetime/_mapping)'  
> > > -d '{  
> > > "created\_datetime" : {  
> > > "properties" : {  
> > > "created\_datetime" : {"type" : "string"},  
> > > }  
> > > }  
> > > }'
> > > 
> > > ## Why this error? {"error":"\*\*MapperParsingException[Failed to parse mapping definition]; nested: JsonParseException[Unexpected character ('}' (code 125)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: {\n "created\_datetime" : {\n "properties" : {\n "created\_datetime" : {"type" : "string"},\n }\n }\n}; line: 5, column: 10]]; ","status":400}
> > > 
> > > 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.  
> > > For more options, visit [https://groups.google](https://groups.google).\*\*com/groups/opt\_out[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:52am UTC](https://discuss.elastic.co/t/es-mapping-problem/10652/6 "2017-07-06T02:52:31Z")

</div>


