lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John_C...@platts.com
Subject Re: Searching Date Fields
Date Thu, 01 May 2003 14:41:29 GMT



Instead of using a DateFilter for queries, I have had very good luck in simply
using the internal representation of the dates in a range search.  For example:

     issue_date:[0debn3bk0 TO 0df]

Can anyone explain the advantages/disadvantages of doing date queries
in such a way over using a DateFilter?

thanks,
-John






Stephane Vaucher <vauchers@cirano.qc.ca> on 05/01/2003 10:13:25 AM


Please respond to "Lucene Users List" <lucene-user@jakarta.apache.org>
                                                              
                                                              
                                                              
 To:      Lucene Users List <lucene-user@jakarta.apache.org>, 
          Sushma Sinha <sushma@translogicsys.com>             
                                                              
 cc:      (bcc: John Chun/ST/FIS)                             
                                                              
                                                              
                                                              
 Subject: Re: Searching Date Fields                           
                                                              





Use dateToString(Date date) one way and stringToTime(String s) the other.
You can check the validity of your Date object by printing it out using
its toString() method. It's normal to see something like 0debn3bk0, its
the internal representation of the date.

For searches, use the DateFilter.

On Thu, 1 May 2003, Sushma Sinha wrote:

> Can someone help me on using date fields,
> I need to peform searching on date fields. I am able to add date fields to
index using
> DateField.dateToString(messageDate) - where messageDate is a Date object , of
format yyyy-MM-dd.
> This does not show any error while indexing .(Assuming I am doing something
wrong with the formats)
>
> While reading the createdDate field value from the index (in String form), it
shows up this column value in some format similar to this 0debn3bk0.
> And further I want to know in what format should i enter data to get query
results as specifying a valid date for the
> field while searching does not featch any results .
>
> Any idea about what am I doing wrong?
>
>
> - Sushma
>
>
>
>
>
>


---------------------------------------------------------------------
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


Mime
View raw message