You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Scott Smith <ss...@mainstreamdata.com> on 2009/06/17 01:41:25 UTC

Getting results for a specific date

Mostly, our users want to see search results in reverse date order
(newer hits first).  I know how to do that with a Sort object and it
works fine.

 

However, sometimes our users want to do a search and get results in date
order starting at a certain date.  Say for example, they want to start
their search with documents on June 10.  That wouldn't be a big deal
except that once they display the first page of results for June 10,
they may page in either direction.  What I mean by this is that they may
continue looking at older stories from June 10 or (the problematic case)
they might page to look at newer stories on June 9.

 

So, a single date range query doesn't seem to me to quite cut it.  My
solution has been to set up two queries-one with the date range of "June
10 or older" and one with a date range of "newer than June 10".  I think
that will work, but it's a bit of a juggling act.

 

Does anyone have a better solution?


RE: Getting results for a specific date

Posted by Scott Smith <ss...@mainstreamdata.com>.
Clarification: Obviously, I should have said "June 11" when I talked of a newer date.

________________________________

From: Scott Smith [mailto:ssmith@mainstreamdata.com]
Sent: Tue 6/16/2009 5:41 PM
To: java-user@lucene.apache.org
Subject: Getting results for a specific date



Mostly, our users want to see search results in reverse date order
(newer hits first).  I know how to do that with a Sort object and it
works fine.



However, sometimes our users want to do a search and get results in date
order starting at a certain date.  Say for example, they want to start
their search with documents on June 10.  That wouldn't be a big deal
except that once they display the first page of results for June 10,
they may page in either direction.  What I mean by this is that they may
continue looking at older stories from June 10 or (the problematic case)
they might page to look at newer stories on June 9.



So, a single date range query doesn't seem to me to quite cut it.  My
solution has been to set up two queries-one with the date range of "June
10 or older" and one with a date range of "newer than June 10".  I think
that will work, but it's a bit of a juggling act.



Does anyone have a better solution?




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org