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 Paul <pa...@nines.org> on 2012/10/18 23:27:45 UTC
facet by "in the past" and "in the future"
I have some documents that contain a date field. I'd like to set up a
facet that groups the dates in two buckets: 1) before today, 2) today
and in the future.
It seems like I should be using range faceting, but I don't see how to
set up the parameters. Is there another way to get what I want?
The way my user interface will look is:
Status
----------
[x] Open (26)
[ ] Closed (127)
Where "open" will be all the documents that don't have a date in the past.
Thanks!
Re: facet by "in the past" and "in the future"
Posted by Paul <pa...@nines.org>.
That is perfect! Thanks. I never would have stumbled onto that.
On Thu, Oct 18, 2012 at 5:40 PM, Michael Ryan <mr...@moreover.com> wrote:
> This should do it:
> facet=true&facet.query=yourDateField:([* TO NOW/DAY-1MILLI])&facet.query=yourDateField:([NOW/DAY TO *])
>
> -Michael
>
> -----Original Message-----
> From: Paul [mailto:paul@nines.org]
> Sent: Thursday, October 18, 2012 5:28 PM
> To: solr-user@lucene.apache.org
> Subject: facet by "in the past" and "in the future"
>
> I have some documents that contain a date field. I'd like to set up a
> facet that groups the dates in two buckets: 1) before today, 2) today
> and in the future.
>
> It seems like I should be using range faceting, but I don't see how to
> set up the parameters. Is there another way to get what I want?
>
> The way my user interface will look is:
>
> Status
> ----------
> [x] Open (26)
> [ ] Closed (127)
>
> Where "open" will be all the documents that don't have a date in the past.
>
> Thanks!
RE: facet by "in the past" and "in the future"
Posted by Michael Ryan <mr...@moreover.com>.
This should do it:
facet=true&facet.query=yourDateField:([* TO NOW/DAY-1MILLI])&facet.query=yourDateField:([NOW/DAY TO *])
-Michael
-----Original Message-----
From: Paul [mailto:paul@nines.org]
Sent: Thursday, October 18, 2012 5:28 PM
To: solr-user@lucene.apache.org
Subject: facet by "in the past" and "in the future"
I have some documents that contain a date field. I'd like to set up a
facet that groups the dates in two buckets: 1) before today, 2) today
and in the future.
It seems like I should be using range faceting, but I don't see how to
set up the parameters. Is there another way to get what I want?
The way my user interface will look is:
Status
----------
[x] Open (26)
[ ] Closed (127)
Where "open" will be all the documents that don't have a date in the past.
Thanks!