Skip to content

Latest commit

 

History

History
23 lines (22 loc) · 535 Bytes

QueryDslRange.md

File metadata and controls

23 lines (22 loc) · 535 Bytes

Query Dsl Range

  • Used to match on any range of values
  • Equivalent of sql statement:
select * from orders where id >= 1 and id <= 2
  • Example
curl -XPOST 'localhost:9200/orders/orders/_search?pretty=true' \
  -H 'content-type:application/json' \
  -d '{
   "query" : {
      "range" : {
        "id" : {
        "gte" : 1,
        "lte" : 2
        }
      }
    }
}'