apache / apache/lucene

Allow LeafFieldComparators to publish feature values [LUCENE-8949]

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

Description

We allow LeafFieldComparators to only accept a docID, get the equivalent feature value(s) and compare against the bottom/top of the values set for the comparator. This mandates that the values being compared against the bottom/top should originate from the same comparator. This does not allow use cases such as cross comparator value comparisons i.e. if a user wanted to compute the "global" minimum across multiple comparators.

 

FieldComparators expose an API to get the feature value corresponding to a docID. We should let LeafFieldComparators do the same. A new comparison method is not required since the parent FieldComparator's compare method can be used once the values are retrieved.

---
Migrated from [LUCENE-8949](https://issues.apache.org/jira/browse/LUCENE-8949) by Atri Sharma (@atris), updated Sep 26 2019

Contributor guide

Open the contributing guide

Research direction

Start by reading the FieldComparator and LeafFieldComparator APIs described in the issue, focusing on how a docID is currently converted into a feature value and compared with the bottom or top value. Done means LeafFieldComparators can expose the value for a docID so callers can use the parent FieldComparator comparison for values from different comparators.

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.