Fix es bool and float term queries#50
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for bool and float literal values in Elasticsearch DSL term queries (and other queries that accept short‑form scalar values) by renaming StringOrStructForSerialization to LiteralOrStructForSerialization and extending its visitor to accept bool and f64 (in addition to existing i64/u64/string/map). Also widens the TermQueryParams.value deserializer to accept Bool and F64 and adds new ES compatibility integration tests.
Changes:
- Rename
StringOrStructForSerialization→LiteralOrStructForSerialization; addvisit_boolandvisit_f64so short‑form scalar query values like{ "term": { "field": true } }and{ "term": { "field": 1.1 } }deserialize as strings. - Extend
TermValueinterm_query.rswithBoolandF64variants for object‑form term values, with new unit tests. - Add ES compatibility scenarios for bool/float term queries (and a bool prefix query expected to 400), and ingest
float_fieldin thesimple_es_compatsetup.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| quickwit/quickwit-query/src/elastic_query_dsl/mod.rs | Wire up the renamed literal_or_struct module and re-export. |
| quickwit/quickwit-query/src/elastic_query_dsl/literal_or_struct.rs | Rename helper and add visit_bool / visit_f64; update docstring. |
| quickwit/quickwit-query/src/elastic_query_dsl/term_query.rs | Use new helper; accept Bool/F64 in TermValue; add unit tests. |
| quickwit/quickwit-query/src/elastic_query_dsl/prefix_query.rs | Switch to LiteralOrStructForSerialization. |
| quickwit/quickwit-query/src/elastic_query_dsl/wildcard_query.rs | Switch to LiteralOrStructForSerialization. |
| quickwit/quickwit-query/src/elastic_query_dsl/match_query.rs | Switch to LiteralOrStructForSerialization. |
| quickwit/quickwit-query/src/elastic_query_dsl/match_phrase_query.rs | Switch to LiteralOrStructForSerialization. |
| quickwit/quickwit-query/src/elastic_query_dsl/match_bool_prefix.rs | Switch to LiteralOrStructForSerialization. |
| quickwit/rest-api-tests/scenarii/es_compatibility/0006-term_query.yaml | New bool/float term‑query scenarios; drop ES‑only restriction on numeric short‑form. |
| quickwit/rest-api-tests/scenarii/es_compatibility/0030-prefix.yaml | New bool short‑form prefix step expecting 400. |
| quickwit/rest-api-tests/scenarii/es_compatibility/_setup.quickwit.yaml | Ingest float_field values for new term tests. |
| quickwit/rest-api-tests/scenarii/es_compatibility/_setup.elasticsearch.yaml | Mirror ingest of float_field on ES. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
950717b to
cd3c1db
Compare
Darkheir
approved these changes
May 29, 2026
Collaborator
Author
|
Also tested with internal platform integration tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
QW should support bool and float term queries on the ES DSL
How was this PR tested?
Unit + integ tests