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 host unknown <li...@hotmail.com> on 2003/06/27 16:39:23 UTC

date ranges.....

Hi all

Here's my scenario....

I'm building a calendaring application and using Lucene (one of many times 
I've used it on our site) for the indexing/retrieval mechanism.  The 
calendar has events.  An event consists of:  start date, end date, start 
time, end time, and descriptive information.  Most begin and end on the same 
day, however not all of them.

Here's where the problem lies.  Let's say an event runs from 20030625 (june 
25 2003) until 20030701 and I want to search all events (several thousand) 
and know what's happening today (20030727).  The results I'm looking for can 
be described with this sql statement:  "Select * from events where 
start_date <= 20030627 and end_date >=20030627".  How do i write this 
'query' with Lucene?

Many thanks,
Dominic

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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


RE: date ranges.....

Posted by Aviran Mordo <am...@infosciences.com>.
Use RangeQuery to search on the date field

-----Original Message-----
From: host unknown [mailto:linux_newbie@hotmail.com] 
Sent: Friday, June 27, 2003 10:39 AM
To: lucene-user@jakarta.apache.org
Subject: date ranges.....


Hi all

Here's my scenario....

I'm building a calendaring application and using Lucene (one of many
times 
I've used it on our site) for the indexing/retrieval mechanism.  The 
calendar has events.  An event consists of:  start date, end date, start

time, end time, and descriptive information.  Most begin and end on the
same 
day, however not all of them.

Here's where the problem lies.  Let's say an event runs from 20030625
(june 
25 2003) until 20030701 and I want to search all events (several
thousand) 
and know what's happening today (20030727).  The results I'm looking for
can 
be described with this sql statement:  "Select * from events where 
start_date <= 20030627 and end_date >=20030627".  How do i write this 
'query' with Lucene?

Many thanks,
Dominic

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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



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