WeightedSpanTermExtractor unnexessarily enforces rewrite for some SpanQueiries [LUCENE-8637]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Method mustRewriteQuery(SpanQuery) returns true for SpanPositionCheckQuery, SpanContainingQuery, SpanWithinQuery, and SpanBoostQuery, however, these queries do not require rewriting. One effect of this is e.g. that UnifiedHighlighter does not work with OffsetSource Postings and switches to Analysis which of course has consequences for performance.
I attach a patch for lucene version 7.6.0. I have not checked whether it breaks existing unit tests.
---
Migrated from [LUCENE-8637](https://issues.apache.org/jira/browse/LUCENE-8637) by Christoph Goller, updated Mar 21 2022
Attachments: [WeightedSpanTermExtractor.java](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-8637/WeightedSpanTermExtractor.java)
Linked issues:
- #11513
Contributor guide
Assessment
This issue has not been assessed yet.