Skip to content

Instantly share code, notes, and snippets.

@kimchy
Created November 30, 2011 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimchy/1409479 to your computer and use it in GitHub Desktop.
Save kimchy/1409479 to your computer and use it in GitHub Desktop.
curl -XPUT localhost:9200/test/type1/1 -d '{
a : [
{ x:1, y:2 },
{ x:2, y:3 }
]
}'
curl -XPOST localhost:9200/test/_refresh
curl 'localhost:9200/test/_search?q=*&fields=a.x'
@rajasekaran07
Copy link

I am getting the below error while passing the curl -XPUT command.

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"json_parse_exception","reason":"Unexpected character ('a' (code 97)): was expecting double-quote to start field name\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@13e87de7; line: 2, column: 6]"}},"status":400}

--Raja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment