Skip to content

Instantly share code, notes, and snippets.

@jprante
Created October 22, 2013 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jprante/7099463 to your computer and use it in GitHub Desktop.
Save jprante/7099463 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 }
}
}
}'
@manmanluo
Copy link

good!

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