Hmmm, I _think_ pivot faceting works here. One dimension would be day
and the other retweet count. The response will have the number of
retweets per day, you'd have to sum them up I suppose.

Best,
Erick

On Mon, May 5, 2014 at 3:18 PM, Romain <romain....@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
>
> On current workaround would be to do a date rage facet to get the date
> slots and ask only for the retweet field and compute the sums in the
> client. We could compute other stats like average, etc... too
>
> The closest I could see was
> https://issues.apache.org/jira/browse/SOLR-4772but it seems to be
> slightly different.
>
> Basically I am trying to do something very similar to the Date Histogram
> Facet<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html#search-facets-date-histogram-facet>in
> ES.
>
> Is there a way to move the counting logic to the Solr server?
>
> Thanks!
>
> Romain

Reply via email to