apache / apache/lucene

Highlighter does not correctly highlight the phrase around 50th term [LUCENE-2910]

Open
#3,984 1 comment 0 reactions 0 assignees View on GitHub
affects-version:2.9.4 legacy-jira-priority:Trivial module:highlighter type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

When you use the Highlighter combined with N-Gram tokenizers such as CJKTokenizer and try to highlight the phrase that appears around 50th term in the field, the highlighted phrase is shorter than expected.

```
e.g. Highlighting "fooo" in the following text with bigram tokenizer:
"0---------1---------2---------3---------4---------fooo---"

Expected: "0---------1---------2---------3---------4---------fooo---"
Actual: "0---------1---------2---------3---------4---------fooo---"
```

---
Migrated from [LUCENE-2910](https://issues.apache.org/jira/browse/LUCENE-2910) by Shinya Kasatani
Attachments: [HighlighterFix.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2910/HighlighterFix.patch)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.