You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Crawdaddy (JIRA)" <ji...@apache.org> on 2014/08/19 16:39:18 UTC

[jira] [Updated] (SOLR-6354) Support stats over functions

     [ https://issues.apache.org/jira/browse/SOLR-6354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Crawdaddy updated SOLR-6354:
----------------------------

    Attachment: TstStatsComponent.java

Here's my start at this.  

If desired, this can be built as a replacement Stats Component by putting it's JAR in /webapp/WEB-INF/lib so it can access ResponseBuilder's package private _statsInfo.

I added a few "// SOLR-6354" comments around my changes.


> Support stats over functions
> ----------------------------
>
>                 Key: SOLR-6354
>                 URL: https://issues.apache.org/jira/browse/SOLR-6354
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: Hoss Man
>         Attachments: TstStatsComponent.java
>
>
> The majority of the logic in StatsValuesFactory for dealing with stats over fields just uses the ValueSource API.  There's very little reason we can't generalize this to support computing aggregate stats over any arbitrary function (or the scores from an arbitrary query).
> Example...
> {noformat}
> stats.field={!func key=mean_rating mean=true}prod(user_rating,pow(editor_rating,2))
> {noformat}
> ...would mean that we can compute a conceptual "rating" for each doc by multiplying the user_rating field by the square of the editor_rating field, and then we'd compute the mean of that "rating" across all docs in the set and return it as "mean_rating"



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org