apache / apache/lucene

Boolean Query with MatchNoDocs in MUST/FILTER could be rewritten [LUCENE-9208]

Open
#10,248 1 comment 0 reactions 0 assignees View on GitHub
legacy-jira-label:patch legacy-jira-priority:Trivial type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Currently BooleanQuery rewrites to MatchNoDocs query if MUST_NOT clause contains MatchAllDocs . Same approach could be applied if FILTER/MUST clauses contains MatchNoDocs

---
Migrated from [LUCENE-9208](https://issues.apache.org/jira/browse/LUCENE-9208) by Nirmal Chidambaram
Attachments: [LUCENE-9208.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-9208/LUCENE-9208.patch)

Contributor guide

Open the contributing guide

Research direction

Start by reading BooleanQuery's rewrite logic and the attached LUCENE-9208.patch, focusing on how MUST_NOT clauses containing MatchAllDocs are handled. Confirm the expected behavior for MUST and FILTER clauses containing MatchNoDocs; done means those cases rewrite consistently to MatchNoDocs with appropriate test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.