This is super nice, I tried (even without subfacets) and it works! Thanks a
lot!

Romain

facet=true&facet.range=price&facet.range.start=0&facet.range.end=1000&facet.range.gap=100&facet.stat=avg(popularity)


facets": { "price": { "buckets": [ { "val": "0.0", "avg(popularity)":
3.5714285714285716 }, { "val": "100.0", "avg(popularity)": 5.5 }, { "val":
"200.0", "avg(popularity)": 6 }, { "val": "300.0", "avg(popularity)":
7.666666666666667 }, { "val": "400.0", "avg(popularity)": 7 }, { "val":
"500.0", "avg(popularity)": "NaN" }, { "val": "600.0", "avg(popularity)": 7},
{ "val": "700.0", "avg(popularity)": "NaN" }, { "val": "800.0", "
avg(popularity)": "NaN" }, { "val": "900.0", "avg(popularity)": "NaN" } ], "
gap": 100, "start": 0, "end": 1000 }


On Tue, May 6, 2014 at 3:15 PM, Yonik Seeley <yo...@heliosearch.com> wrote:

> On Tue, May 6, 2014 at 5:30 PM, Romain Rigaux <rom...@cloudera.com> wrote:
> > This looks nice!
> >
> > The only missing piece for more interactivity would be to be able to map
> > multiple field values into the same bucket.
> >
> > e.g.
> >
> > http://localhost:8983/solr/query?
> >    q=*:*
> >    &facet=true
> >    &facet.field=*round(date, '15MINUTES')*
> >    &facet.stat=sum(retweetCount)
> >
> > This is a bit similar to
> > SOLR-4772<https://issues.apache.org/jira/browse/SOLR-4772>for the
> > rounding.
> >
> > Then we could zoom out just by changing the size of the bucket, without
> any
> > index change, e.g.:
> > http://localhost:8983/solr/query?
> >    q=*:*
> >    &facet=true
> >    &facet.field=*round(date, '1HOURS')*
> >    &facet.stat=sum(retweetCount)
>
> For this specific example, I think "map multiple field values into the
> same bucket" equates to a range facet?
>
> facet.range=mydatefield
> facet.range.start=...
> facet.range.end=...
> facet.range.gap=+1HOURS
> facet.stat=sum(retweetCount)
>
> And then if you need additional breakouts by time range, you can use
> subfacets:
>
> subfacet.mydatefield.field=mycategoryfield
>
> That will provide retweet counts broken out by "mycategoryfield" for
> every bucket produced by the range query.
>
> See http://heliosearch.org/solr-subfacets/
>
> -Yonik
> http://heliosearch.org - facet functions, subfacets, off-heap
> filters&fieldcache
>

Reply via email to