lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Rigaux <rom...@cloudera.com>
Subject Re: Histogram facet?
Date Tue, 06 May 2014 21:30:16 GMT
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)

Romain

On Tue, May 6, 2014 at 10:09 AM, Yonik Seeley <yonik@heliosearch.com> wrote:

> On Mon, May 5, 2014 at 6:18 PM, Romain <romain.net@gmail.com> wrote:
> > Hi,
> >
> > I am trying to plot a non date field by time in order to draw an
> histogram
> > showing its evolution during the week.
> >
> > For example, if I have a tweet index:
> >
> > Tweet:
> >   date
> >   retweetCount
> >
> > 3 tweets indexed:
> > Tweet | Date | Retweet
> > A        01/01   100
> > B        01/01   100
> > C        01/02   100
> >
> > If I want to plot the number of tweets by day: easy with a date range
> facet:
> > Day 1: 2
> > Day 2: 1
> >
> > But now counting the number of retweet by day is not possible natively:
> > Day 1: 200
> > Day 2: 100
>
> Check out "facet functions" in Heliosearch (an experimental fork of Solr):
> http://heliosearch.org/solr-facet-functions/
>
> All you would need to do is add:
> facet.stat=sum(retweetCount)
>
> -Yonik
> http://heliosearch.org - solve Solr GC pauses with off-heap filters
> and fieldcache
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message