Skip to content

Skip split searches for match_none queries - #6789

Open
PSeitz-dd wants to merge 2 commits into
quickwit-oss:mainfrom
PSeitz-dd:match_none
Open

PSeitz-dd wants to merge 2 commits into
quickwit-oss:mainfrom
PSeitz-dd:match_none

Conversation

@PSeitz-dd

Copy link
Copy Markdown
Contributor

Summary

  • Return an empty split list for resolved top-level MatchNone queries before querying the metastore for splits.
  • Preserve request validation and existing empty-result aggregation finalization.
  • Add a regression test asserting that no split lookup occurs.

Testing

  • make fmt
  • cd quickwit && cargo nextest run -p quickwit-search (210 tests passed)

@PSeitz-dd
PSeitz-dd requested a review from a team as a code owner September 9, 2026 14:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdb9429b25

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

true,
None,
)?;
all_queries_empty &= query.as_any().is::<EmptyQuery>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not infer split emptiness from the latest schema

When an index contains splits created before a tokenizer mapping update, this query is compiled only against the latest doc_mapper.schema(). For example, if an old split indexed "-" with the raw tokenizer and the field later switched to the default tokenizer, a full-text query for "-" becomes an EmptyQuery under the latest schema even though compiling it against the old split schema would match that document. Rewriting the request to MatchNone then skips every split and silently drops valid hits; emptiness must be established independently of schema evolution or checked against the actual split schemas.

Useful? React with 👍 / 👎.

true,
None,
)?;
all_queries_empty &= query.as_any().is::<EmptyQuery>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Detect empty queries beneath boost wrappers

When a no-match clause is wrapped in QueryAst::Boost, such as an explicitly boosted MatchNone or a boosted full-text query that produces zero terms, query construction returns a BoostQuery containing an EmptyQuery; consequently this concrete-type check is false. Boolean simplification also treats that wrapper as an opaque leaf, so these requests still list and search every split despite being guaranteed to return no hits. Propagate semantic emptiness through query wrappers rather than relying only on a top-level EmptyQuery downcast.

Useful? React with 👍 / 👎.

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.

2 participants