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

Greg Miller commented on LUCENE-9946:
-------------------------------------

Just as a small update on this, I've hit a little speed bump in my 
implementation due to a bug in my approach I discovered when writing tests. The 
logic for rolling up range counts (in {{LongRangeCounter}}) needs to be 
revisited to support multi-value cases, which is a little non-trivial. A few 
cases to think through:
 # A multi-valued field contributes counts to multiple elementary intervals in 
the segment tree that roll up to different ranges. Each range should get a 
count of {{1}} from the doc. The doc should only contribute {{1}} to 
{{FacetResult#value}}.
 # A multi-valued field contributes counts to multiple elementary intervals in 
the segment tree that roll up to some of the same ranges. Each range should 
receive a count of {{1}} from the doc (need to ensure multiple elementary 
ranges rolling up to the same range don't double-count). The doc should only 
contribute {{1}} to {{FacetResult#value}}.
 # A multi-valued field contributes counts to the same elementary interval in 
the segment tree. The individual ranges that the elementary interval rolls up 
into should all only receive a count of {{1}} from the doc (need to ensure the 
elementary interval doesn't get double counted, contributing > {{1}} to the 
ranges it rolls up to). The doc should only contribute {{1}} to 
{{FacetResult#value}}.

I'll circle back to this in a few days as I have more time to work on it.

> Support multi-value fields in range facet counting
> --------------------------------------------------
>
>                 Key: LUCENE-9946
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9946
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>    Affects Versions: main (9.0)
>            Reporter: Greg Miller
>            Priority: Minor
>
> The {{RangeFacetCounts}} implementations ({{LongRangeFacetCounts}} and 
> {{DoubleRangeFacetCount}}) only work on single-valued fields today. In 
> contrast, the more recently added {{LongValueFacetCounts}} implementation 
> supports both single- and multi-valued fields (LUCENE-7927). I'd like to 
> extend multi-value support to both of the {{LongRangeFacetCounts}} 
> implementations as well.
> Looking through the implementations, I can't think of a good reason to _not_ 
> support this, but maybe I'm overlooking something?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to