apache / apache/lucene

Fast vector highlighter: Allow access to start/end offsets [LUCENE-3007]

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

Description

Hello everyone,

Apparently, the fast vector highlighter assumes all of its clients want to highlight HTML. However, there are some people (like me) who would like to implement highlighting on a text-only document view, so nothing but the highlighting start/end offsets are needed.

This works quite well with Lucene's standard highlighter. Unfortunately, there seems to be no officially supported way to access the start/end offsets that are computed by the fast vector highlighter. More precisely, all the needed information is stored in the linked list org.apache.lucene.search.vectorhighlight.FieldPhraseList.phraseList, but there's no way to access it, except using reflection or modifying the highlighter source code.

So my proposal is to provide some methods for accessing this particular field, or any other means to get the highlighting start/end offsets of the fast vector highlighter. Thanks in advance!

Best regards
Tran Nam Quang

---
Migrated from [LUCENE-3007](https://issues.apache.org/jira/browse/LUCENE-3007) by Nam-Quang Tran

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.