On so many websites they teach how to query data from Elasticsearch using range query. I would like to query data that is less than or equal to a certain number from Elasticsear
I think you wanna query the documents with less than equal to 100.
curl -XPOST "http://hostname:9200/index/try/_search" -d'
{
"query": {
"range": {
"FieldName": {
"lte" : 100
}
}
}
}'
PHP API client
array(
'query' => array(
'range' => array(
'FieldName' => array(
array("lte" => 100)
)
)
)
);
for more queries.. refer
The query format thet you asked for..!
curl -XPOST "http://hostname:9200/index/type/_search?q=FieldName:[* to 100]"
HOpe it helps..!