You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jim Freeby <ja...@yahoo.com.INVALID> on 2018/05/11 16:23:27 UTC

Facet Range with Stats

All,
I'd like to generate stats for the results of a facet range.
For example, calculate the mean sold price over a range of months.
Does anyone know how to do this?
This Jira issue seems to indicate its not yet possible.
[SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA

| 
| 
|  | 
[SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA


 |

 |

 |



Thanks,  

Jim

Re: Facet Range with Stats

Posted by Jim Freeby <ja...@yahoo.com.INVALID>.
 Correction.  The solution below did not quite get what we need.
I need the stats reports for the range.
I'll keep digging on this one

    On ‎Friday‎, ‎May‎ ‎11‎, ‎2018‎ ‎10‎:‎59‎:‎45‎ ‎AM‎ ‎PDT, Jim Freeby <ja...@yahoo.com.INVALID> wrote:  
 
  I found a solution.
If I use tags for the facet range definition and the stats definition, I can include it in the facet pivot
stats=true
stats.field={!tag=piv1 percentiles='50'}price
facet=true
facet.range={!tag=r1}someDate
f.someDate.facet.range.start=2018-01-01T00:00:00Z
f.someDate.facet.range.end=2018-04-30T00:00:00Z
f.someDate.facet.range.gap=+1MONTH
facet.pivot={!stats=piv1 range=r1}category
Please let me know if there's a better way to achieve this.
Cheers,

Jim

    On ‎Friday‎, ‎May‎ ‎11‎, ‎2018‎ ‎09‎:‎23‎:‎39‎ ‎AM‎ ‎PDT, Jim Freeby <ja...@yahoo.com.INVALID> wrote:  
 
 All,
I'd like to generate stats for the results of a facet range.
For example, calculate the mean sold price over a range of months.
Does anyone know how to do this?
This Jira issue seems to indicate its not yet possible.
[SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA

| 
| 
|  | 
[SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA


 |

 |

 |



Thanks,  

Jim    

Re: Facet Range with Stats

Posted by Jim Freeby <ja...@yahoo.com.INVALID>.
 I found a solution.
If I use tags for the facet range definition and the stats definition, I can include it in the facet pivot
stats=true
stats.field={!tag=piv1 percentiles='50'}price
facet=true
facet.range={!tag=r1}someDate
f.someDate.facet.range.start=2018-01-01T00:00:00Z
f.someDate.facet.range.end=2018-04-30T00:00:00Z
f.someDate.facet.range.gap=+1MONTH
facet.pivot={!stats=piv1 range=r1}category
Please let me know if there's a better way to achieve this.
Cheers,

Jim

    On ‎Friday‎, ‎May‎ ‎11‎, ‎2018‎ ‎09‎:‎23‎:‎39‎ ‎AM‎ ‎PDT, Jim Freeby <ja...@yahoo.com.INVALID> wrote:  
 
 All,
I'd like to generate stats for the results of a facet range.
For example, calculate the mean sold price over a range of months.
Does anyone know how to do this?
This Jira issue seems to indicate its not yet possible.
[SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA

| 
| 
|  | 
[SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA


 |

 |

 |



Thanks,  

Jim  

Re: Facet Range with Stats

Posted by Chris Hostetter <ho...@fucit.org>.
: I'd like to generate stats for the results of a facet range.
: For example, calculate the mean sold price over a range of months.
: Does anyone know how to do this?
: This Jira issue seems to indicate its not yet possible.
: [SOLR-6352] Let Stats Hang off of Range Facets - ASF JIRA

This is possible using the JSON Facet API...

https://lucene.apache.org/solr/guide/7_3/json-facet-api.html

This newer API syntax is more expressive and easier to add new syntax to, 
so it's unlikely you'll see more features like this added to the older 
faceting API -- and will geet less and less likely as time goes on.


-Hoss
http://www.lucidworks.com/