[
https://issues.apache.org/jira/browse/SOLR-6351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14091538#comment-14091538
]
Hoss Man commented on SOLR-6351:
--------------------------------
Proposed implementation...
* Modify the Pivot facet code to check for a "stats" local param
* if a stats tag name is specified, each time a {{NamedList<Integer>}} of "top"
terms is computed at a given level of the pivot tree (either single node or on
an initial shard request, or as part of a refinement request), each of those
terms should be applied as a filter on the main doc set - the result should be
used to construct a {{SimpleStats}}
* the {{SimpleStats}} class should then be asked to compute the neccessary
stats based on the tags
** {{SimpleStats}} will need refactored: probably with a new {{StatsField}}
class for modeling each {{stats.field}} param (and the {{StatsValues}} that
hang off of it) and new accessor methods to get the list of all {{StatsField}}s
so the pivot facet class can find the ones it needs by tag
** in single node mode, just ask each {{StatsField}} to compute the stats
** in cloud mode:
*** in the shard requests, ask each {{StatsField}} to compute it's distributed
stats based on the params it knows about
*** in the coordinator request, once the pivot constraints are merged &
refined, the refinement phase should merge all of the {{StatsValues}} at the
same time it's summing up the facet counts.
* we need to think carefully about "exclusions" because they might be different
** ie: {{facet.pivot\{!ex=some_fq
stats=s1\}foo,bar&stats.field=\{!ex=other_fq\}price}}
** i think what we want in general is for the "ex" localparam of the
{{stats.field}} to be ignored when hanging off of a {{facet.pivot}}
** OR: we union the exclusions (so the computed stats are over more docs then
what the facet count returns)
** OR: we fail if they both specify "ex" and they aren't identical
> Let Stats Hang off of Pivots (via 'tag')
> ----------------------------------------
>
> Key: SOLR-6351
> URL: https://issues.apache.org/jira/browse/SOLR-6351
> Project: Solr
> Issue Type: Sub-task
> Reporter: Hoss Man
>
> he goal here is basically flip the notion of "stats.facet" on it's head, so
> that instead of asking the stats component to also do some faceting
> (something that's never worked well with the variety of field types and has
> never worked in distributed mode) we instead ask the PivotFacet code to
> compute some stats X for each leaf in a pivot. We'll do this with the
> existing {{stats.field}} params, but we'll leverage the {{tag}} local param
> of the {{stats.field}} instances to be able to associate which stats we want
> hanging off of which {{facet.pivot}}
> Example...
> {noformat}
> facet.pivot={!stats=s1}category,manufacturer
> stats.field={!key=avg_price tag=s1 mean=true}price
> stats.field={!tag=s1 min=true max=true}user_rating
> {noformat}
> ...with the request above, in addition to computing the min/max user_rating
> and mean price (labeled "avg_price") over the entire result set, the
> PivotFacet component will also include those stats for every node of the tree
> it builds up when generating a pivot of the fields "category,manufacturer"
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]