TermAutomatonQuery should act more like a conjunction [LUCENE-6396]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
TermAutomatonQuery currently acts like a disjunction of its terms, and then in countMatches() it reads positions to find a match.
Ideally it would act more like a conjunction, that only starts reading positions when its possible to reach an accept state via the set of PostingsEnums positioned on the current document.
If the query is (a|b) (c|d) then it shouldnt even read positions if only 'a' or 'a and b' are positioned at the current document, for example. it should move on.
It would also be great to support two-phase iteration here.
---
Migrated from [LUCENE-6396](https://issues.apache.org/jira/browse/LUCENE-6396) by Robert Muir (@rmuir)
Contributor guide
Research direction
Start by reading TermAutomatonQuery and its countMatches() method, then trace how the PostingsEnums are positioned for the current document. Compare the current disjunctive behavior with the (a|b) (c|d) example and investigate the two-phase iteration path. Done means avoiding position reads when no accept state is reachable and supporting two-phase iteration where appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100