apache / apache/lucene

Better maximum scores for boolean queries [LUCENE-8510]

Open
#9,556 0 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

The maximum score of boolean queries is the sum of the maximum score of each clause. In the common case that each sub query runs on the same field, we might be able to get better estimates though. Say the query looks like "body:A body:B": if the maximum score of "body:A" is obtained for a document of length X and the maximum score of "body:B" is obtained for a document of length Y!=X then the sum of these maximum scores may never be reached: since both clauses have to match the same document, the maximum scores of each clause should be computed for the same value of the norm.

Improving our APIs to improve this sounds challenging, but I was wondering that we could obtain almost the same result by enabling to sort by norm value, so that we would combine maximum scores of clauses that have the same norm.

---
Migrated from [LUCENE-8510](https://issues.apache.org/jira/browse/LUCENE-8510) by Adrien Grand (@jpountz)

Contributor guide

Open the contributing guide

Research direction

Start by examining Lucene's Boolean query scoring and norm-related APIs described in the issue. Determine whether clauses on the same field can combine maximum scores for compatible norm values without changing the public APIs. Done means producing demonstrably tighter maximum-score estimates while preserving correct Boolean query scoring.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.