apache / apache/lucene

FastVectorHighlighter - add position offset to FieldPhraseList.WeightedPhraseInfo.Toffs [LUCENE-3243]

Open
#4,316 2 comments 0 reactions 0 assignees View on GitHub
affects-version:3.2 legacy-jira-label:feature legacy-jira-label:lucene 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

Needed to return position offsets along with highlighted snippets when using FVH for highlighting.

Using the (#4214) patch I was able to get the fragInfo for a particular Phrase search. Currently the Toffs(Term offsets) class only stores the start and end offset.

To get the position offset, I added the position offset information in Toffs and FieldPhraseList class.

---
Migrated from [LUCENE-3243](https://issues.apache.org/jira/browse/LUCENE-3243) by Jahangir Anwari, updated Jun 27 2011
Environment:
```
Lucene 3.2
```

Attachments: [CustomSolrHighlighter.java](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-3243/CustomSolrHighlighter.java), [LUCENE-3243.patch.diff](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-3243/LUCENE-3243.patch.diff)

Contributor guide

Open the contributing guide

Research direction

Start by reading LUCENE-3243.patch.diff and the attached CustomSolrHighlighter.java, then trace FieldPhraseList and FieldPhraseList.WeightedPhraseInfo.Toffs in the current Lucene sources. The change is done when FVH phrase highlighting can return position offsets alongside each term's start and end offsets, with applicable tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
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.