Elasticsearch 9 · Searching

Combine conditions

Require a text match and filter by price without affecting the score.

curl -u elastic:$ELASTIC_PASSWORD --cacert http_ca.crt "https://localhost:9200/products/_search?pretty" -H "Content-Type: application/json" -d '{"query":{"bool":{"must":[{"match":{"name":"laptop"}}],"filter":[{"range":{"price":{"lte":1000}}}]}}}'

Official Elasticsearch 9 documentation

More searching commands

All searching commands · Elasticsearch 9 cheatsheet

Was this page helpful?