Skip to content

Fix es bool and float term queries#50

Merged
rdettai-sk merged 1 commit into
sekoiafrom
fix-es-bool-float-queries
May 29, 2026
Merged

Fix es bool and float term queries#50
rdettai-sk merged 1 commit into
sekoiafrom
fix-es-bool-float-queries

Conversation

@rdettai-sk
Copy link
Copy Markdown
Collaborator

Description

QW should support bool and float term queries on the ES DSL

How was this PR tested?

Unit + integ tests

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StringOrStructForSerializationLiteralOrStructForSerialization; add visit_bool and visit_f64 so short‑form scalar query values like { "term": { "field": true } } and { "term": { "field": 1.1 } } deserialize as strings.
  • Extend TermValue in term_query.rs with Bool and F64 variants 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_field in the simple_es_compat setup.

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.

Comment thread quickwit/rest-api-tests/scenarii/es_compatibility/0030-prefix.yaml Outdated
@rdettai-sk rdettai-sk force-pushed the fix-es-bool-float-queries branch from 950717b to cd3c1db Compare May 29, 2026 15:04
@rdettai-sk
Copy link
Copy Markdown
Collaborator Author

Also tested with internal platform integration tests

@rdettai-sk rdettai-sk merged commit 2544fc0 into sekoia May 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants