× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Indexing a data through curl throwing MapperParsingException?

Feb 16, 2015
<p>The problem is that you use the same quote sign for properties and values inside the JSON object as well as the document itself which you are passing to curl.</p> <p>Run this command instead:</p> <pre><code>curl -XPUT "http://localhost:9200/movies/movie/1" -d '{ "title": "The Godfather","director": "Francis Ford Coppola","year": 1972}' </code></pre> <hr> <p><strong>Update:</strong></p> <p>since you are running the command on windows, the above solution won't work, instead your answer can be answered here: <a href="http://stackoverflow.com/questions/4257490/how-to-post-put-request-under-the-windows-using-curl">How to post PUT request under the Windows using curl?</a></p> <p>This resulting command should work:</p> <pre><code>curl -X PUT "http://localhost:9200/movies/movie/1" -d" { ""title"": ""The Godfather"",""director"": ""Francis Ford Coppola"",""year"": 1972}" </code></pre> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/22530774/Indexing%20a%20data%20through%20curl%20throwing%20MapperParsingException?/22531210">Stack Overflow</a>.</p>
comments powered by Disqus