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

Hoss Man commented on SOLR-6351:
--------------------------------

{quote}
so i guess the question is: is the current general stats behavior a "bug" that 
should be fixed, or is this the "correct" way to deal with stats when none of 
the documents have a value (and thus: the behavior of your "hasValue" logic was 
correct) ?

i'm leaning towards" bug" ... but i'd like to think about it more and hear how 
others feel..
{quote}

More on this here: 
https://issues.apache.org/jira/browse/SOLR-6349?focusedCommentId=14165856&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14165856

The "right thing to do" for now is almost certainly to make the new code in 
SOLR-6351 for handing stats off pivots consistent with the existing code in 
StatsComponent...

{code}
if (isShard == true || (Long) stv.get("count") > 0) {
  stats_fields.add(statsField.getOutputKey(), stv);
} else {
  stats_fields.add(statsField.getOutputKey(), null);
}
{code}

...then later, probably in SOLR-6349 where depending on the "count" stat to 
return other stats is going to be a blocker problem, we can revisit the 
question.

> 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
>         Attachments: SOLR-6351.patch, SOLR-6351.patch, SOLR-6351.patch, 
> SOLR-6351.patch, SOLR-6351.patch, SOLR-6351.patch
>
>
> 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.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to