Unable to create mapping using cURL commands

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"
{"acknowledged":true}

cURL command to create mapping:

curl -X PUT "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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6a068363-f0c2-4b03-9bf0-cf0f4e80be29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 27 févr. 2015 à 20:05, Anandkumar Gunasekaran 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"
{"acknowledged":true}

cURL command to create mapping:

curl -X PUT "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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6a068363-f0c2-4b03-9bf0-cf0f4e80be29%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/C4C178B0-0882-45D8-A353-60CC21A6B967%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c13c5941-6ecd-4260-ba31-7698a51e841b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 27 févr. 2015 à 22:34, Anandkumar Gunasekaran 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.
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?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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/34C70667-1ADC-445E-993A-B4B5E887A793%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.