Unable to Index: Elasticsearch 2.3.0:Windows 10

Hi ,

I am unable to do -XPUT. please guide me on how I can do it.. below is the screenshot of the error message.

C:>curl -XPUT "localhost:9200/megacorp/employee/1" { "first_name" : "John", "last_name" : "Smith", "age" : "25","about" : "I love to go rock climbing","interests" : ["sports","music"] }
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse, document is empty"}],"type":"mapper_parsing_exception","reason":"failed to parse, document is empty"},"status":400}curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: first_name

Length Required

Length Required


HTTP Error 411. The request must be chunked or have a content length.

curl: (6) Could not resolve host: John, curl: (6) Could not resolve host: last_name Length Required

Length Required


HTTP Error 411. The request must be chunked or have a content length.

curl: (6) Could not resolve host: Smith, curl: (6) Could not resolve host: age Length Required

Length Required


HTTP Error 411. The request must be chunked or have a content length.

curl: (6) Could not resolve host: 25,about Length Required

Length Required


HTTP Error 411. The request must be chunked or have a content length.

curl: (6) Could not resolve host: I love to go rock climbing,interests Length Required

Length Required


HTTP Error 411. The request must be chunked or have a content length.

curl: (3) [globbing] bad range in column 6 curl: (3) [globbing] unmatched close brace/bracket in column 1

Your curl string was not correct. I put into sense and made it work and copied back to curl

Try this
curl -XPUT "http://localhost:9200/megacorp/employee/1 " -d'
{ "first_name" : "John", "last_name" : "Smith", "age" : "25","about" : "I love to go rock climbing","interests" : ["sports","music"] }'

Curl on windows is just a pain.

IIRC you have to create a json file and pass it to the command line. -d was not working for me.

I'd really suggest using SENSE or any browser plugin like REST Console.

Yes, curl on windows not work well.
So I run curl in Cygwin :slight_smile: