apache / apache/lucene

Highlighter mergeContiguousFragments shouldn't merge 0-score fragments [LUCENE-6471]

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

Description

Highlighter.mergeContiguousFragments merges adjacent fragments it is given. But it is given a list of fragments that do not necessarily have embedded highlights (e.g. have a score of 0), and so it could grow a fragment needlessly. I never figured out why this old highlighter keeps around such fragments instead of eagerly tossing them when the fragment completes, which is what I think it should do. That would address this problem and might make things faster. I'm not sure if any highlighter user wants the non-scoring fragments though.

---
Migrated from [LUCENE-6471](https://issues.apache.org/jira/browse/LUCENE-6471) by David Smiley (@dsmiley), 1 vote, updated Jul 11 2017

Contributor guide

Open the contributing guide

Research direction

Locate Highlighter.mergeContiguousFragments and inspect its callers and existing tests. Reproduce the behavior with adjacent zero-score fragments, then determine from the surrounding highlighter behavior whether they should be discarded or preserved. Done means the intended handling is covered by a regression test without unnecessarily merging zero-score fragments.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.