InstantiatedIndex : TermFreqVector is missing [LUCENE-1964]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
TermFrecVector is missing when index is created via constructor.
The constructor expect that fields with TermVector are retreived with the getFields call, but this call returns only stored field, but such fields are never/rarely stored.
I've attached a patch to fix this issue.
I had to add a int freq field to InstantiatedTermDocumentInformation because we are not sure we can use the size of termPositions array as freq information, this information may not be available with TermVector.YES.
Don't know if did well but works with unit test attached.
---
Migrated from [LUCENE-1964](https://issues.apache.org/jira/browse/LUCENE-1964) by David Causse, updated Nov 30 2013
Environment:
```
java 1.6
```
Attachments: [iiw-regression-fix.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-1964/iiw-regression-fix.patch), [term-vector-fix.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-1964/term-vector-fix.patch)
Contributor guide
Research direction
Review the InstantiatedIndex constructor and its getFields behavior, then inspect InstantiatedTermDocumentInformation and the attached regression and unit-test patches. Verify that term vectors remain available for fields that are not stored and that frequency information is preserved, using the attached unit test as the completion check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100