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

Greg Miller edited comment on LUCENE-10246 at 7/1/22 12:27 AM:
---------------------------------------------------------------

[~shahrs87] I'd start by becoming familiar with the existing "association 
facet" implementations ({{TaxonomyFacetIntAssociations}} and 
{{TaxonomyFacetFloatAssociations}} as well as looking at some demo code like 
{{AssociationsFacetsExample}}). The API contract they implement represent 
results with {{FacetResult}}, which contains a list of {{LabelAndValue}} 
instances. {{LabelAndValue}} only models a single label along with a single 
numeric value. The value "usually" represents a total faceting count for a 
label in "non-association" facets, but with association faceting, value takes 
on an aggregated weight "associated" with the label.

The idea with this Jira is to be able to convey _both_ an aggregated weight and 
the count associated with a label. The best way to do that without creating a 
weird API for non-association cases is something that will probably take a 
little thought. Should we just put another "count" field in {{LabelAndValue}} 
and have both value and count be populated with a count for non-association 
cases? That sounds weird.

So beyond understanding what's currently there, I think the next step is to 
think about the right way to evolve the API that doesn't create a weird 
interaction for non-association faceting, especially since those are more 
commonly used.

Please reach out here as you have questions and I'll do my best to answer in a 
timely fashion. Thanks for having a look at this!


was (Author: gsmiller):
[~shahrs87] I'd start by becoming familiar with the existing "association 
facet" implementations ({{TaxonomyFacetIntAssociations}} and 
{{TaxonomyFacetFloatAssociations}} as well as looking at some demo code like 
{{AssociationsFacetsExample}}). The API contract they implement represent 
results with {{FacetResult}}, which contains a list of {{LabelAndValue}} 
instances. {{LabelAndValue}} only models a single label along with a single 
numeric value. The value "usually" represents a total faceting count for a 
label in "non-association" facets, but with association faceting, value takes 
on an aggregated weight "associated" with the label.

The idea with this Jira is to be able to convey _both_ an aggregated weight and 
the count associated with a label. The best way to do that without creating a 
weird API for non-association cases is something that will probably take a 
little thought. Should we just put another "count" field in {{LabelAndValue}} 
and have both value and count be populated with a count for non-assocation 
cases? That sounds weird.

So beyond understanding what's currently there, I think the next step is to 
think about the right way to evolve the API that doesn't create a weird 
interaction for non-association faceting, especially since those are more 
commonly used.

> Support getting counts from "association" facets
> ------------------------------------------------
>
>                 Key: LUCENE-10246
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10246
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>            Reporter: Greg Miller
>            Priority: Minor
>
> We have these nice "association" facet implementations today that aggregate 
> "weights" from the docs that facet over, but they don't keep track of counts. 
> So the user can get "top-n" values for a dim by aggregated weight (great!), 
> but can't know how many docs matched each value. It would be nice to support 
> this so users could show the top-n values but _also_ show counts associated 
> with each.



--
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