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

ryantxu edited comment on SOLR-680 at 9/29/08 9:49 PM:
-------------------------------------------------------------

updated patch:

with the sample data:
http://localhost:8983/solr/select?q=*:*&stats=true&stats.field=price&stats.field=popularity&stats.stddev=true&rows=0
returns
{code:xml}
<lst name="stats">
  <lst name="stats_fields">
    <lst name="price">
        <double name="min">0.0</double>
        <double name="max">2199.0</double>
        <double name="sum">5251.2699999999995</double>
        <long name="count">15</long>
        <long name="missing">11</long>
        <double name="mean">350.08466666666664</double>
        <double name="median">399.0</double>
        <double name="stddev">547.7375579061129</double>
   </lst>
   <lst name="popularity">
        <double name="min">0.0</double>
        <double name="max">10.0</double>
        <double name="sum">90.0</double>
        <long name="count">26</long>
        <long name="missing">0</long>
        <double name="mean">3.4615384615384617</double>
        <double name="median">7.0</double>
        <double name="stddev">3.557873176275616</double>
   </lst>
</lst>
</lst>
{code}

Changes:
 - changed "qt" to "count"
 - changed "ave" to "mean"  (so it sits nicely with median)
 - added stats support to solrj
 - added test to example jetty/embedded runners

now it just needs a little documentaion, then i think ready to go...


      was (Author: ryantxu):
    updated patch:

with the sample data:
http://localhost:8983/solr/select?q=*:*&stats=true&stats.field=price&stats.field=popularity&stats.stddev=true&rows=0
returns
{code:xml}
<lst name="stats">
  <lst name="stats_fields">
    <lst name="price">
        <double name="min">0.0</double>
        <double name="max">2199.0</double>
        <double name="sum">5251.2699999999995</double>
        <long name="qt">15</long>
        <long name="missing">11</long>
        <double name="mean">350.08466666666664</double>
        <double name="median">399.0</double>
        <double name="stddev">547.7375579061129</double>
   </lst>
   <lst name="popularity">
        <double name="min">0.0</double>
        <double name="max">10.0</double>
        <double name="sum">90.0</double>
        <long name="qt">26</long>
        <long name="missing">0</long>
        <double name="mean">3.4615384615384617</double>
        <double name="median">7.0</double>
        <double name="stddev">3.557873176275616</double>
   </lst>
</lst>
</lst>
{code}

Changes:
 - changed "qt" to "count"
 - changed "ave" to "mean"  (so it sits nicely with median)
 - added stats support to solrj
 - added test to example jetty/embedded runners

now it just needs a little documentaion, then i think ready to go...

  
> StatsComponent - get min, max, sum, qt, avg of number fields
> ------------------------------------------------------------
>
>                 Key: SOLR-680
>                 URL: https://issues.apache.org/jira/browse/SOLR-680
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>            Reporter: Koji Sekiguchi
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-680.patch, SOLR-680.patch, SOLR-680.patch
>
>
> StatsComponent - it returns min,max,sum,qt,avg of specified number fields:
> request parameters:
> &stats=on&stats.field=price
> {code:xml}
> <stats>
>  <stats_fields>
>    <lst name="price">
>        <double name="min">10</double>
>        <double name="max">30</double>
>        <double name="avg">20</double>
>        <double name="sum">60</double>
>        <double name="qt">3</double>
>    </lst>
>  </stats_fields>
> </stats>
> {code}
> WRT "stats", the component can output sum and avg, but not sd and var.
> USE CASE:
> StatsComponent can be used to get "market price" of DocSet e.g. rental 
> housing site, package tour site.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to