Faceting on a date field multiple times

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Faceting on a date field multiple times

Ian Holsman-2
Hi.

I would like to be able to do a facet on a date field, but with different ranges (in a single query).

for example. I would like to show

#documents by day for the last week -
#documents by week for the last couple of months
#documents by year for the last several years.

is there a way to do this without hitting solr 3 times?


thanks
Ian
Reply | Threaded
Open this post in threaded view
|

Re: Faceting on a date field multiple times

Marc Sturlese
Reply | Threaded
Open this post in threaded view
|

Re: Faceting on a date field multiple times

Ian Holsman-2
Thanks Marc.
On May 4, 2012, at 8:52 PM, Marc Sturlese wrote:

> http://lucene.472066.n3.nabble.com/Multiple-Facet-Dates-td495480.html
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Faceting-on-a-date-field-multiple-times-tp3961282p3961865.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Faceting on a date field multiple times

Sujit Pal
In reply to this post by Ian Holsman-2
Hi Ian,

I believe you may be able to use a bunch of facet.query parameters, something like this:

facet.query=yourfield:[NOW-1DAY TO NOW]
facet.query=yourfield:[NOW-2DAY to NOW-1DAY]
...
and so on.

-sujit

On May 3, 2012, at 10:41 PM, Ian Holsman wrote:

> Hi.
>
> I would like to be able to do a facet on a date field, but with different ranges (in a single query).
>
> for example. I would like to show
>
> #documents by day for the last week -
> #documents by week for the last couple of months
> #documents by year for the last several years.
>
> is there a way to do this without hitting solr 3 times?
>
>
> thanks
> Ian