Hi,

If you are still not went live already, I would suggest to use the long instead 
of date field. According to our testing, search based on date fields are very 
slow when compared to search based on long field.

You can use System.getTimeInMillis() to get the time
When showing it to the user, apply a date formatter.

When taking input from user, let him enter whatever the date he wants to and 
then you can convert to "long" and do your searches based on it.

Experts can pitch in with any other ideas..

Thanks,
sS

--- On Tue, 9/8/09, Gérard Dupont <ger.dup...@gmail.com> wrote:

> From: Gérard Dupont <ger.dup...@gmail.com>
> Subject: date field
> To: solr-user@lucene.apache.org
> Cc: "Nicolas Bureau" <nicolas....@gmail.com>
> Date: Tuesday, September 8, 2009, 8:51 AM
> Hi all,
> 
> I'm currently facing a little difficulty to index and
> search on date field.
> The indexing is done in the right way (I guess) and I can
> find valid date in
> the field like "2009-05-01T12:45:32Z". However when I'm
> searching the user
> don't always give an exact date. for instance they give
> "2008-05-01" to get
> all documents related to that day.  I can do a trick
> using wildcard but is
> there another way to do it ? Moreover if they give the full
> date string (or
> if I hack the query parser) I can have the full syntax, but
> then the ":"
> annoy me because the Lucene parser does not allow it
> without quotes. Any
> ideas ?
> 
> -- 
> Gérard Dupont
> Information Processing Control and Cognition (IPCC) - EADS
> DS
> http://weblab.forge.ow2.org
> 
> Document & Learning team - LITIS Laboratory
> 


     

Reply via email to