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

Michael Gibney commented on SOLR-13132:
---------------------------------------

Thanks for looking into this [~solrtrey]. The merge conflicts were trivial (an 
extra accidental change of the word "parallel" to "sweep" in a comment for some 
code since removed from master, and the upstream removal of 
{{BlockJoinFieldFacetAccumulator}}, which had some incidental changes (obviated 
by the removal of the class). I've rebased the original PR ([PR 
751|https://github.com/apache/lucene-solr/pull/751]), resolving both conflicts 
cleanly in favor of {{master}}.

Sorry for the confusion about the multiple patches. To clear things up, I'd 
like to move forward focusing on [PR 
751|https://github.com/apache/lucene-solr/pull/751]. PR 751 is functionally 
identical to [^SOLR-13132-with-cache-01.patch], with the only changes being 
some method name refactoring (I had initially used the word "parallel" to 
denote the "single pass" approach to facet collection over multiple DocSet 
domains; feedback from several informal reviewers (yourself included iirc, 
[~solrtrey]) indicated that the word "parallel" fostered the misconception that 
the technique involved had something to do with "parallel _processing_" – i.e. 
in the "multithreaded" sense – hence the refactoring in the PR, replacing the 
word "parallel" with "sweep").

> Improve JSON "terms" facet performance when sorted by relatedness 
> ------------------------------------------------------------------
>
>                 Key: SOLR-13132
>                 URL: https://issues.apache.org/jira/browse/SOLR-13132
>             Project: Solr
>          Issue Type: Improvement
>          Components: Facet Module
>    Affects Versions: 7.4, master (9.0)
>            Reporter: Michael Gibney
>            Priority: Major
>         Attachments: SOLR-13132-with-cache-01.patch, 
> SOLR-13132-with-cache.patch, SOLR-13132.patch
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> When sorting buckets by {{relatedness}}, JSON "terms" facet must calculate 
> {{relatedness}} for every term. 
> The current implementation uses a standard uninverted approach (either 
> {{docValues}} or {{UnInvertedField}}) to get facet counts over the domain 
> base docSet, and then uses that initial pass as a pre-filter for a 
> second-pass, inverted approach of fetching docSets for each relevant term 
> (i.e., {{count > minCount}}?) and calculating intersection size of those sets 
> with the domain base docSet.
> Over high-cardinality fields, the overhead of per-term docSet creation and 
> set intersection operations increases request latency to the point where 
> relatedness sort may not be usable in practice (for my use case, even after 
> applying the patch for SOLR-13108, for a field with ~220k unique terms per 
> core, QTime for high-cardinality domain docSets were, e.g.: cardinality 
> 1816684=9000ms, cardinality 5032902=18000ms).
> The attached patch brings the above example QTimes down to a manageable 
> ~300ms and ~250ms respectively. The approach calculates uninverted facet 
> counts over domain base, foreground, and background docSets in parallel in a 
> single pass. This allows us to take advantage of the efficiencies built into 
> the standard uninverted {{FacetFieldProcessorByArray[DV|UIF]}}), and avoids 
> the per-term docSet creation and set intersection overhead.



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