You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Greg Miller (Jira)" <ji...@apache.org> on 2022/05/05 14:38:00 UTC

[jira] [Comment Edited] (LUCENE-10550) Add getAllChildren functionality to facets

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

Greg Miller edited comment on LUCENE-10550 at 5/5/22 2:37 PM:
--------------------------------------------------------------

I'm also +1 on this but with a minor suggestion.

{quote}The proposed getAllChildren API is to return value/range counts sorted by label values instead of counts. {quote}

I wonder if we should "sort" at all for this functionality? If we're returning all children for a specified path, the caller can just as easily sort by whatever criteria they want (or maybe none at all), so sorting within the implementation might be wasteful. Also, for range faceting, the user is providing a list of ranges they care about up-front in a specific order. I would actually propose we retain that order instead of sorting by the range "values" in some way. This is what range faceting currently implements (somewhat confusingly) behind the {{getTopChildren}} API. The order of those ranges might have some meaning to the caller, so it might be best to retain it. What do you think?


was (Author: gsmiller):
I'm also +1 on this but with a minor suggestion.

> The proposed getAllChildren API is to return value/range counts sorted by label values instead of counts. 

I wonder if we should "sort" at all for this functionality? If we're returning all children for a specified path, the caller can just as easily sort by whatever criteria they want (or maybe none at all), so sorting within the implementation might be wasteful. Also, for range faceting, the user is providing a list of ranges they care about up-front in a specific order. I would actually propose we retain that order instead of sorting by the range "values" in some way. This is what range faceting currently implements (somewhat confusingly) behind the {{getTopChildren}} API. The order of those ranges might have some meaning to the caller, so it might be best to retain it. What do you think?

> Add getAllChildren functionality to facets
> ------------------------------------------
>
>                 Key: LUCENE-10550
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10550
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: modules/facet
>            Reporter: Yuting Gan
>            Priority: Minor
>
> Currently Lucene does not support returning range counts sorted by label values, but there are use cases demanding this feature. For example, a user specifies ranges (e.g., [0, 10], [10, 20]) and wants to get range counts without changing the range order. Today we can only call getTopChildren to populate range counts, but it would return ranges sorted by counts (e.g., [10, 20] 100, [0, 10] 50) instead of range values. 
> Lucene has a API, getAllChildrenSortByValue, that returns numeric values with counts sorted by label values, please see [LUCENE-7927|https://issues.apache.org/jira/browse/LUCENE-7927] for details. Therefore, it would be nice that we can also have a similar API to support range counts. The proposed getAllChildren API is to return value/range counts sorted by label values instead of counts. 
> This proposal was inspired from the discussions with [~gsmiller] when I was working on the LUCENE-10538 [PR|https://github.com/apache/lucene/pull/843], and we believe users would benefit from adding this API to Facets. 
> Hope I can get some feedback from the community since this proposal would require changes to the getTopChildren API in RangeFacetCounts. Thanks!



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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