UnifiedHighlighter cannot handle SpanMultiTermQueryWrapper with an Automaton of type SINGLE [LUCENE-9274]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
MultiTermHighlighting.extractAutomata ignores a Term from a SINGLE Automaton and Highlighting does not work.
Of course an AutomatonQuery with a single term does not make much sense, but it may be generated by an automatic process.
Possible fixes:
- Either implement consumeTerms in MultiTermHighlighting.AutomataCollector
- Or remove special case for SINGLE in CompiledAutomaton.visit
I attatch a Unit Test
---
Migrated from [LUCENE-9274](https://issues.apache.org/jira/browse/LUCENE-9274) by Christoph Goller, updated Mar 12 2020
Attachments: [TestUnifiedHighlighterMTQ.java](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-9274/TestUnifiedHighlighterMTQ.java)
Contributor guide
Research direction
Start by reading MultiTermHighlighting.extractAutomata and its AutomataCollector, then compare the SINGLE handling in CompiledAutomaton.visit. Use the attached TestUnifiedHighlighterMTQ.java as the reproduction and verify that UnifiedHighlighter highlights terms from a SpanMultiTermQueryWrapper using a SINGLE automaton.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100