Start with a clean index:

curl -XDELETE "http://localhost:9200/books/";

You probably have a bad mapping (some docs already indexed?)

If you still have problems, please gist a full curl recreation. See 
http://www.elasticsearch.org/help/


--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs


Le 8 janv. 2014 à 03:10, ZenMaster80 <[email protected]> a écrit :

Great, Do you know why I am getting 
{"error":"MapperParsingException[failed to parse]; nested: 
JsonParseException[Unrecognized token 'life': was expecting ('true', 'false' or 
'null')\n at [Source: [B@5c9a9d06; line: 1, column: 35]]; ","status":400}

data:

{“books”:[{“name”:”life in heaven”,”author”:”Mike Smith”},{“name”:”get 
rich”,”author”:”Joe Shmoe”},{“name”:”luxury properties”,”author”:”Linda 
Jones”}]}




> On Tuesday, January 7, 2014 9:06:01 PM UTC-5, Ivan Brusic wrote:
> The JSON file is used by the curl command, so in your example it should be in 
> the same directory in which you executed the command (current directory).
> 
> -- 
> Ivan
> 
> 
>> On Tue, Jan 7, 2014 at 6:00 PM, ZenMaster80 <[email protected]> wrote:
>> Hi,
>> 
>> I am just starting with ElasticSearch, I would like to know how to index a 
>> simple json document "books.json" that has the following in it: Where do I 
>> place the document? I placed it in root directory of elastic search and in 
>> /bin folder..
>> 
>> {“books”:[{“name”:”life in heaven”,”author”:”Mike Smith”},{“name”:”get 
>> rich”,”author”:”Joe Shmoe”},{“name”:”luxury properties”,”author”:”Linda 
>> Jones”]}}
>> 
>> 
>> $ curl -XPUT "http://localhost:9200/books/book/1"; -d @books.json
>> 
>> Warning: Couldn't read data from file "books.json", this makes an empty POST.
>> {"error":"MapperParsingException[failed to parse, document is 
>> empty]","status":400}
>> 
>> 
>> 
>> Thanks
>> 
>> -- 
>> 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 [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/a5c1e37f-9472-499c-9499-1475c944f47b%40googlegroups.com.
>> For more options, visit 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/5d15fcdf-4a0f-4d92-9dd3-f07899d915fe%40googlegroups.com.
For more options, visit 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/E9FE0784-B10E-48AD-9C46-45B44B1513B9%40pilato.fr.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to