apache / apache/lucene

Add score threshold into Scorer.score() [LUCENE-3364]

Open
#4,437 13 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major module:core/query/scoring type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

This is an optimization for scoring.
Given a Scorer.score() implementation, where features are gathered to calculate a score.

Proposal, add a parameter to score, e.g. score(float threshold)

This threshold is the minimum score to "beat" to make it to the current PriorityQueue. This could potential save a great deal of wasted calculation in the cases where recall is large.

In our case specifically, some of the features needed to do calculation can be expensive to obtain, it would be nice to have a place to decide whether or not even fetching these features are necessary.

Also, if we know the score would be low, simply threshold can be returned.

Let me know if this makes sense and I can work on a patch.

---
Migrated from [LUCENE-3364](https://issues.apache.org/jira/browse/LUCENE-3364) by John Wang, updated Oct 13 2011

Contributor guide

Open the contributing guide

Research direction

Start by reading Scorer.score() and tracing how its scores are compared with the current PriorityQueue threshold. Identify the relevant scoring tests and define how the threshold parameter should behave, including the case where expensive feature calculations can be skipped; done means the API and scoring behavior are specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.