apache / apache/lucene

UnifiedHighlighter: distinguish no field from no passages in field [LUCENE-9556]

Open
#10,595 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major module:highlighter type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The UnifiedHighlighter does not distinguish between highlighting a field that is absent on a document, and highlighting a field that is present but no passages were found (can happen for a variety of reasons) – both cases produce null. While not a huge deal in general, it's an annoyance. It can be useful for the user/client to detect the content was present but not highlightable so that it might take some default action, like returning the whole field value (possibly to process in some way) or highlighting some other field.

---
Migrated from [LUCENE-9556](https://issues.apache.org/jira/browse/LUCENE-9556) by David Smiley (@dsmiley)
Linked issues:
- [SOLR-10321](https://issues.apache.org/jira/browse/SOLR-10321)

Contributor guide

Open the contributing guide

Research direction

Start with the UnifiedHighlighter entry point and trace how it handles a missing field versus a present field with no passages. The work is done when those two cases are distinguishable to the user, including the no-passages case described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.