Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created May 6, 2013 21:21
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 dakrone/5528298 to your computer and use it in GitHub Desktop.
Save dakrone/5528298 to your computer and use it in GitHub Desktop.
broken get for integer arrays
#!/usr/bin/env zsh
curl -XDELETE localhost:9200/get-test
curl -XPOST 'localhost:9200/get-test' -d'
{
"mappings": {
"doc": {
"_source": {
"enabled": true
},
"properties": {
"num": {
"type": "integer"
}
}
}
},
"settings": {
"number_of_replicas": 0,
"number_of_shards": 1
}
}'
echo
curl -XPOST 'localhost:9200/get-test/doc/1' -d'{"num":2}'
echo
curl -XPOST 'localhost:9200/get-test/doc/2' -d'{"num":[2,1]}'
echo
curl 'localhost:9200/get-test/doc/1?pretty'
echo
curl 'localhost:9200/get-test/doc/2?pretty'
echo
# broken
curl 'localhost:9200/get-test/doc/2?fields=num&pretty'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment