Skip to content

Instantly share code, notes, and snippets.

@newthinker
Forked from jprante/rangequery.sh
Created November 29, 2015 14: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 newthinker/93a8c46a581e69207aa4 to your computer and use it in GitHub Desktop.
Save newthinker/93a8c46a581e69207aa4 to your computer and use it in GitHub Desktop.
Range query example
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/data/1' -d '
{
"numbers":[11,23,13,16,17,23.6]
},
'
curl -XPUT 'localhost:9200/test/data/2' -d '
{
"numbers":[1,2,3,4,5,6,7,8,8.9,9.1,9.4]
}
'
curl -XPUT 'localhost:9200/test/data/3' -d '
{
"numbers":[101,230,150,200]
}
'
curl -XGET 'localhost:9200/test/_refresh'
curl -XGET 'localhost:9200/test/_search?pretty' -d '
{
"query" : {
"range": {
"numbers": { "gt" : 10, "lt" : 23.9 }
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment