apache / apache/lucene

Declare MaxScoreAccumulator and DocScoreEncoder as public

Open
#15,178 2 comments 0 reactions 0 assignees View on GitHub
type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

### Description

[MaxScoreAccumulator](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/MaxScoreAccumulator.java) and [DocScoreEncoder](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/DocScoreEncoder.java) are used when [setting min competitive score](https://github.com/apache/lucene/blob/15b8d54e1da75da236d07220eeb9ea3e9ae15224/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java#L168), now they are declared as protected, but if we want to set min competitive score in [FirstPassGroupingCollector](https://github.com/apache/lucene/blob/main/lucene/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java) or in [OpenSearch#CollapsingTopDocsCollector](https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/apache/lucene/search/grouping/CollapsingTopDocsCollector.java) for performance improvement, these two classes cannot be accessed, so I propose to declare the two classes and their methods as public.

If no concern about this, I will launch a PR for it.

Contributor guide

Open the contributing guide

Research direction

Start with lucene/core/src/java/org/apache/lucene/search/MaxScoreAccumulator.java and DocScoreEncoder.java, then inspect their use in TopScoreDocCollector.java and the proposed grouping collectors. Confirm which classes and methods need public visibility so FirstPassGroupingCollector and CollapsingTopDocsCollector can access them; done means those consumers can use the API without access errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.