Elasticsearch query builder
Turn a list of field/operator/value conditions into an Elasticsearch bool query.
Elasticsearch query builder
Paste a list of conditions and this tool assembles a complete Elasticsearch search request: a bool query with must, should, must_not and filter branches, plus sorting, pagination and an optional aggregation. It suits anyone who writes queries by hand for Kibana Dev Tools, a REST client or an application's search layer and would rather describe the conditions than retype the JSON scaffolding every time.
Each condition is one line in the Conditions field: an optional branch (must, should, must_not, filter), a field name, an optional condition type (term for an exact match, match for full-text search, range for comparisons, exists to check a field is present), and a value — separated by semicolons. "filter price range 100..500" builds a range clause; "should title match wireless headphones" builds a full-text match on a phrase; "must email exists" checks the field is set. Leave the type off and Default condition type fills it in; leave the branch off and Default branch does the same, so a quick list like "status active; category electronics" still produces a valid query.
The options panel covers the rest of a real search request: Sort field and order add a sort clause, Page size and Offset control from/size pagination, and Aggregation turns on a terms or date_histogram bucket over a field you choose. Highlight matches adds a highlight block for any match conditions, and Query language version toggles track_total_hits, available only from Elasticsearch 7 onward.
Everything runs in your browser — the conditions you type and the query that comes out are never uploaded anywhere. Copy the result straight into Kibana Dev Tools or a request body, download it as a .txt file, or send the output back to the input to keep refining it.