apache / apache/lucene

TermVectorAccessor return terms that do not match with current document [LUCENE-4720]

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

Description

For each term, TermVectorAccessor looks in the indexReader and calls termPositions.skipTo(documentNumber) but this methods returns the first document with id greater or equal to documentNumber.
As a result you get some extra terms that do not really match with documentNumber.

---
Migrated from [LUCENE-4720](https://issues.apache.org/jira/browse/LUCENE-4720) by Francois-Xavier Bonnet
Attachments: [SOLR-4360.txt](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-4720/SOLR-4360.txt)

Contributor guide

Open the contributing guide

Research direction

Start by locating TermVectorAccessor and reading how it uses indexReader, termPositions.skipTo(documentNumber), and documentNumber. Reproduce the term-vector lookup for a document with gaps in matching document IDs, then verify that the returned terms belong only to the requested document.

Written by the indexing model from the issue text.

Assessment

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