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 Olivier Amira <ol...@webmotion.com> on 2002/07/05 19:34:19 UTC

Queries on dates...

Hi all.

I'm sorry if this question was already posted, but I didn't find one.

In order to be able to perform searches on dates, I'm thinking on how to 
design my application; what is the best to be able to search on dates, 
assuming the format is something like that "yyyy-mm-dd"?
Maybe add 3 differents fields in the Lucene's document for each part of 
the date? but after, how could I perform searches like files older than 
a date or else...
Or is it better to use external filters (something completly independant 
from the search engine)?

Thanks.

-- 
-----  Olivier Amira  -----
WEBMOTION, Ottawa - Canada
olivier.amira@webmotion.com




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Queries on dates...

Posted by Terry Steichen <te...@net-frame.com>.
Olivier,

Use a range query - such as date_field:[null - 20020705] for all up to
today's date, date_field:[20020615 - null] for all before June 15, etc.
Also, date_field:200206* for all in June 2002.

Regards,

Terry

----- Original Message -----
From: "Olivier Amira" <ol...@webmotion.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Friday, July 05, 2002 1:34 PM
Subject: Queries on dates...


> Hi all.
>
> I'm sorry if this question was already posted, but I didn't find one.
>
> In order to be able to perform searches on dates, I'm thinking on how to
> design my application; what is the best to be able to search on dates,
> assuming the format is something like that "yyyy-mm-dd"?
> Maybe add 3 differents fields in the Lucene's document for each part of
> the date? but after, how could I perform searches like files older than
> a date or else...
> Or is it better to use external filters (something completly independant
> from the search engine)?
>
> Thanks.
>
> --
> -----  Olivier Amira  -----
> WEBMOTION, Ottawa - Canada
> olivier.amira@webmotion.com
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>