apache / apache/lucene

Change getAllChildren to return all children regardless of the count [LUCENE-10632]

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

Description

Currently, the getAllChildren functionality is implemented in a way that is similar to getTopChildren, where they only return children with count that is greater than zero.

However, he original getTopChildren in RangeFacetCounts returned all children whether-or-not the count was zero. This actually has good use cases and we should continue supporting the feature in getAllChildren, so that we will not lose it after properly supporting getTopChildren in RangeFacetCounts.

As discussed with @gsmiller in the [LUCENE-10614 pr](https://github.com/apache/lucene/pull/974), allowing getAllChildren to behave differently from getTopChildren can actually be more helpful for users. If users want to get children with only positive count, we have getTopChildren supporting this behavior already. Therefore, the getAllChildren API should provide all children in all of the implementations, whether-or-not the count is zero.

---
Migrated from [LUCENE-10632](https://issues.apache.org/jira/browse/LUCENE-10632) by Yuting Gan (@Yuti-G), updated Jul 13 2022

Contributor guide

Open the contributing guide

Research direction

Start by locating the getAllChildren and getTopChildren entry points and the RangeFacetCounts implementation, then read the linked LUCENE-10614 pull request for context. Check each getAllChildren implementation and its existing tests; done means every implementation returns children with zero or positive counts, while getTopChildren retains its positive-count behavior.

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.