June 2017
Beginner to intermediate
404 pages
8h 22m
English
Range query can be used on numbers and dates to query for all the documents in a given range.
Range query supports the following operators:
An SQL query to query all the products greater than 70 and less than 100 is shown here:
select * from product where unitprice > 70 and unitprice <= 100
The preceding query can be written using a range query as shown here:
POST chapter6/_search { "query": { "range": { "unit_price": { "gt": 70, "lte": 100 } } } }
Similarly, a range query can also be used on dates as shown here:
POST chapter6/_search{ "query": { "range": { "release_date": {Read now
Unlock full access