apache / apache/lucene

Passage knows its own docID [LUCENE-5181]

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

Description

The new PostingsHighlight package allows for retrieval of term matches from a query if one creates a class that extends PassageFormatter and overrides format(). However, class Passage does not have a docID field, nor is this provided via PassageFormatter.format(). Therefore, it's very difficult to know which Document contains a given Passage.

It would suffice for PassageFormatter.format() to be passed the docID as a parameter. From the code in PostingsHighlight, this seems like it would be easy.

---
Migrated from [LUCENE-5181](https://issues.apache.org/jira/browse/LUCENE-5181) by Jon Stewart, updated Aug 26 2013

Contributor guide

Open the contributing guide

Research direction

Start by reading the PostingsHighlight package, especially Passage and PassageFormatter.format(), to trace how passages are created and formatted. Determine how the document ID should reach the formatter, then update the relevant tests so formatting can verify the ID is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.