Skip to content

Instantly share code, notes, and snippets.

@deverton
Created December 14, 2011 00:49
Show Gist options
  • Save deverton/1474679 to your computer and use it in GitHub Desktop.
Save deverton/1474679 to your computer and use it in GitHub Desktop.
Test case for ES Issue #1536
curl -XPUT 'http://localhost:9200/nested_test/' -d '
index :
number_of_shards : 5
number_of_replicas : 0
'
curl -XPUT 'http://localhost:9200/nested_test/nested/_mapping' -d '{"type1":{"properties":{"obj1":{"type":"nested"}}}}'
curl -XPOST 'http://localhost:9200/nested_test/nested/' -d '{"obj1":[{"name":"blue",count:4},{"name":"green",count:6}]}'
curl -XGET 'http://localhost:9200/nested_test/nested/_search?pretty=true' -d'{"query":{"nested": { "path":"obj1"}}}}'
curl -XGET 'http://localhost:9200/nested_test/nested/_search?pretty=true' -d'{"query":{"nested": { "path":"obj1", "query": { "match_all":{}}}}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment