# Unable to create mapping using cURL commands

**URL:** <https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440>\
**Category:** Elasticsearch\
**Created:** [February 27, 2015, 7:05pm UTC](https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440 "2015-02-27T19:05:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anandkumar\_Gunasekar](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Anandkumar\_Gunasekar](https://discuss.elastic.co/u/Anandkumar_Gunasekar)\
**Post date:** [February 27, 2015, 7:05pm UTC](https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440/1 "2015-02-27T19:05:13Z")

</div>

Hi All,

I am unable to create mappings to an index using cURL command.

_cURL command to create index:_

C:\Program Files\cURL\bin\>curl -XPUT "[http://localhost:9200/a](http://localhost:9200/a)"  
{"acknowledged":true}

_cURL command to create mapping:_

curl -X PUT "[http://localhost:9200/a/\_mapping/demand](http://localhost:9200/a/_mapping/demand)" --data-binary@t.txt

_Exception thrown:_

{"error":"MapperParsingException[malformed mapping no root object  
found]","status":400}

_cURL command provided in t.txt file:_

"properties":  
{  
"strCol": {  
"type": "multi\_field", "analyzer": "english", "fields": {"raw": {  
"type": "string", "index": "not\_analyzed" } }  
},  
"longCol": {  
"type": "long"  
},  
"DateCol": {  
"type": "date",  
"format": "dateOptionalTime"  
},  
"doubleCol": {  
"type": "double"  
},  
}

Please help!!

Thanks,  
Anandkumar G

--  
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/6a068363-f0c2-4b03-9bf0-cf0f4e80be29%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6a068363-f0c2-4b03-9bf0-cf0f4e80be29%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:** [February 27, 2015, 8:00pm UTC](https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440/2 "2015-02-27T20:00:57Z")

</div>

Don't use curl on Windows or read its doc. not the same implementation as on Linux.

Use marvel / Sense or any REST plugin for your browser.

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

> Le 27 févr. 2015 à 20:05, Anandkumar Gunasekaran [anandkumartcode@gmail.com](mailto:anandkumartcode@gmail.com) a écrit :
> 
> Hi All,
> 
> I am unable to create mappings to an index using cURL command.
> 
> cURL command to create index:
> 
> C:\Program Files\cURL\bin\>curl -XPUT "[http://localhost:9200/a](http://localhost:9200/a)"  
> {"acknowledged":true}
> 
> cURL command to create mapping:
> 
> curl -X PUT "[http://localhost:9200/a/\_mapping/demand](http://localhost:9200/a/_mapping/demand)" --data-binary@t.txt
> 
> Exception thrown:
> 
> {"error":"MapperParsingException[malformed mapping no root object found]","status":400}
> 
> cURL command provided in t.txt file:
> 
> "properties":  
> {  
> "strCol": {   
> "type": "multi\_field", "analyzer": "english", "fields": {"raw": { "type": "string", "index": "not\_analyzed" } }  
> },  
> "longCol": {  
> "type": "long"  
> },  
> "DateCol": {  
> "type": "date",  
> "format": "dateOptionalTime"  
> },  
> "doubleCol": {  
> "type": "double"  
> },  
> }
> 
> Please help!!
> 
> ## Thanks, Anandkumar G
> 
> 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/6a068363-f0c2-4b03-9bf0-cf0f4e80be29%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6a068363-f0c2-4b03-9bf0-cf0f4e80be29%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/C4C178B0-0882-45D8-A353-60CC21A6B967%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/C4C178B0-0882-45D8-A353-60CC21A6B967%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anandkumar\_Gunasekar](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Anandkumar\_Gunasekar](https://discuss.elastic.co/u/Anandkumar_Gunasekar)\
**Post date:** [February 27, 2015, 9:34pm UTC](https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440/3 "2015-02-27T21:34:39Z")

</div>

Thank you David. Yes, marvel / sense is an excellent tool to achieve it.  
But in my case, I am _not supposed to use CHROME/any other EXCEPT INTERNET  
EXPLORER_ for my requirement.  
It would be great if you can share any other options available in IE with  
REST plugin.

FYI: I am using Internet Explorer 9

with Many Thanks,  
Anandkumar G

--  
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/c13c5941-6ecd-4260-ba31-7698a51e841b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c13c5941-6ecd-4260-ba31-7698a51e841b%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:** [February 27, 2015, 9:46pm UTC](https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440/4 "2015-02-27T21:46:59Z")

</div>

I have no idea. I’m not using IE. May be you should try to google it?  
Marvel needs IE 10: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/marvel/current/_installation.html) [http://www.elasticsearch.org/guide/en/marvel/current/\_installation.html](http://www.elasticsearch.org/guide/en/marvel/current/_installation.html)  
Have a look here as well: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#site) [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#site](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#site)

--  
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) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 27 févr. 2015 à 22:34, Anandkumar Gunasekaran [anandkumartcode@gmail.com](mailto:anandkumartcode@gmail.com) a écrit :
> 
> Thank you David. Yes, marvel / sense is an excellent tool to achieve it.  
> But in my case, I am not supposed to use CHROME/any other EXCEPT INTERNET EXPLORER for my requirement.  
> It would be great if you can share any other options available in IE with REST plugin.
> 
> FYI: I am using Internet Explorer 9
> 
> with Many Thanks,  
> Anandkumar G
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c13c5941-6ecd-4260-ba31-7698a51e841b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c13c5941-6ecd-4260-ba31-7698a51e841b%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/c13c5941-6ecd-4260-ba31-7698a51e841b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c13c5941-6ecd-4260-ba31-7698a51e841b%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [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/34C70667-1ADC-445E-993A-B4B5E887A793%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/34C70667-1ADC-445E-993A-B4B5E887A793%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, 12:29am UTC](https://discuss.elastic.co/t/unable-to-create-mapping-using-curl-commands/22440/5 "2017-07-06T00:29:23Z")

</div>


