[ 
https://issues.apache.org/jira/browse/LUCENE-10632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17566560#comment-17566560
 ] 

Greg Miller commented on LUCENE-10632:
--------------------------------------

Bringing a conversation about this issue we had offline here for transparency 
and future discovery. While I think it would actually be ideal if 
{{getAllChildren}} could actually return _all_ children, regardless of the 
count, it's not really practical in most of our {{Facets}} implementations 
since they only "see" children that exist in the docs they're counting. So if 
they're counting from a {{{}FacetsCollector{}}}, and those hits don't contain 
some of the possible child values for a given dimension, it's quite hard for 
{{getAllChildren}} to actually know about them.

So for now, I think it's reasonable that range facet counting behaves a little 
differently from the rest and actually returns all the ranges it was asked 
about, regardless of count. This is consistent with the behavior of 
{{{}getSpecificValue{}}}, which are both similar use-cases in that the user is 
providing the value(s) they care about. But this does create a small 
inconsistency in the behavior of {{getAllChildren}} generally.

> Change getAllChildren to return all children regardless of the count
> --------------------------------------------------------------------
>
>                 Key: LUCENE-10632
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10632
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Yuting Gan
>            Priority: Minor
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to