apache / apache/lucene

SimilarityBase does not pass docId in the score method for use of FieldCache or DocValues [LUCENE-5167]

Open
#6,231 3 comments 0 reactions 0 assignees View on GitHub
affects-version:4.0 affects-version:4.1 affects-version:4.2 affects-version:4.3.1 affects-version:4.4 legacy-jira-priority:Major module:core/query/scoring type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

SimilarityBase does not pass docId in the score method for use of FieldCache or DocValues.

If the intent of extending SimilarityBase is to use a FieldCache or NumericDocValuesField as part of the scoring, this is not possible because SimilarityBase does not pass on the docId as one of the parameters of the score method. This parameter should be added to the score method so that fieldCache or NumericDocValues can be used when extending SimilarityBase.

---
Migrated from [LUCENE-5167](https://issues.apache.org/jira/browse/LUCENE-5167) by Ross Woolf, updated Aug 14 2013

Contributor guide

Open the contributing guide

Research direction

Start by locating SimilarityBase and its score method, then trace callers and existing implementations to understand the API change. Look for tests covering SimilarityBase, FieldCache, or NumericDocValues and add coverage showing that docId is available for scoring.

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.