Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Range query in ElasticSearch (GET without body)

So very basic question about elasticsearch which the docs not answer very clearly (because they seem to go into many advanced details but miss the basic ones!).

Example: range query

http://www.elasticsearch.org/guide/reference/query-dsl/range-query.html

Doesn't tell how to PERFORM the range, is it via the search endpoint?

And if it is, then how to do it via querystring? I mean, I want to do a GET, not a POST (because it's a query, not an insertion/modification). However the documention for GET requests doesn't tell how to use JSON like in the Range sample:

http://www.elasticsearch.org/guide/reference/api/search/uri-request.html

What am I missing?

Thanks

like image 594
knocte Avatar asked Feb 12 '13 17:02

knocte


1 Answers

Use the Lucene query syntax:

curl -X GET 'http://localhost:9200/my_index/_search?q=my_field:[0+TO+25]&pretty'
like image 148
karmi Avatar answered Sep 27 '22 18:09

karmi