Dear solr-user folks,

I would like to use the stats module to perform very basic statistics
(mean, min and max) which is actually working just fine.

Nethertheless I found a little limitation that bothers me a tiny bit :
how to perform the exact same statistics, but on the result of a
function query rather than a field.

Example :
schema :
- string : id
- float : width
- float : height
- float : depth
- string : color
- float : price

What I'd like to do is something like :
select?price:[45.5 TO
99.99]&stats=on&stats.facet=color&stats.field={volume=product(product(width,
height), depth)}
I would expect to obtain :

<lst name="stats">
 <lst name="stats_fields">
  <lst name="(product(product(width,height),depth))">
   <double name="min">...</double>
   <double name="max">...</double>
   <double name="sum">...</double>
   <long name="count">...</long>
   <long name="missing">...</long>
   <double name="sumOfSquares">...</double>
   <double name="mean">...</double>
   <double name="stddev">...</double>
   <lst name="facets">
    <lst name="color">
     <lst name="white">
      <double name="min">...</double>
      <double name="max">...</double>
      <double name="sum">...</double>
      <long name="count">...</long>
      <long name="missing">...</long>
      <double name="sumOfSquares">...</double>
      <double name="mean">...</double>
      <double name="stddev">...</double>
    </lst>
    <lst name="red">
      <double name="min">...</double>
      <double name="max">...</double>
      <double name="sum">...</double>
      <long name="count">...</long>
      <long name="missing">...</long>
      <double name="sumOfSquares">...</double>
      <double name="mean">...</double>
      <double name="stddev">...</double>
    </lst>
    <!-- Other facets on other colors go here -->
   </lst><!-- end of statistical facets on volumes -->
  </lst><!-- end of stats on volumes -->
 </lst><!-- end of stats_fields node -->
</lst>

Of course computing the volume can be performed before indexing data,
but defining virtual fields on the fly given an arbitrary function is
powerful and I am comfortable with the idea that many others would
appreciate. Especially for BI needs and so on... :-D
Is there a way to do it easily that I would have not been able to
find, or is it actually impossible ?

Thank you very much in advance for your help.

--
Tanguy

Reply via email to