apache / apache/lucene

Add a precise cost of score in ScorerSupplier [LUCENE-10446]

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

Description

Some queries could sometime actually provide a precise cost of Score like RangeFieldQuery, PointRangeQuery, SpatialQuery. maybe we could do some optimization by using this precise cost.

Like in IndexOrDocValuesQuery, when indexScorerSupplier or/and dvScorerSupplier's precise cost is reader.maxDoc, we will supply the right Scorer instead of according to the condition of threshold <= leadCost which sometime supply a inappropriate Score when IndexOrDocValuesQuery not a lead iterator.

---
Migrated from [LUCENE-10446](https://issues.apache.org/jira/browse/LUCENE-10446) by Lu Xugang (@LuXugang), updated Mar 03 2022
Attachments: [LUCENE-10446.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-10446/LUCENE-10446.patch), [LUCENE-10466-1.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-10446/LUCENE-10466-1.patch)

Contributor guide

Open the contributing guide

Research direction

Start by reading ScorerSupplier and the IndexOrDocValuesQuery behavior described in the issue, then review the attached LUCENE-10446 patches for the intended direction. Verify how precise costs from RangeFieldQuery, PointRangeQuery, and SpatialQuery affect scorer selection, and use the relevant query tests to confirm the inappropriate scorer case is corrected.

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.