Ah, didn't know that class exists.  Thanks very much.  Now on to another 
problem, how about handling decimal types?  I see a Util.SmallFloat class that 
may help but it obviously has small precision.  I would like to index 
geographic coordinates, which the database stores as decimal(18,10) and of 
course it's possible to have negative values.

Any recommendations?



________________________________
From: Ron Grabowski <rongrabow...@yahoo.com>
To: lucene-net-user@incubator.apache.org
Sent: Saturday, February 21, 2009 7:04:05 PM
Subject: Re: Basic Dates Question

Have you looked at the DateTools class?

document.Add(new Field("createddate", DateTools.TimeToString(createdTicks, 
DateTools.Resolution.DAY), Field.Store.YES, Field.Index.UN_TOKENIZED));



----- Original Message ----
From: Chester K <ck...@pacbell.net>
To: lucene-net-user@incubator.apache.org
Sent: Saturday, February 21, 2009 9:21:43 PM
Subject: Basic Dates Question

I've been searching on the net for how to handle dates, but none seem to be 
working.  Here's what I'm doing.  Suppose I have a field "StartDate".  When I 
create the index, I'm populating it with something like this:

DateTime dtStartDate;
doc.Add(new Field("StartDate", dtStartDate.ToString(), Field.Store.YES, 
Field.Index.UN_TOKENIZED);
...

Now, I'm using the Luke tool to view the index.  The date appears in the doc as 
a full string, for example,  "2/21/2009 12:00:00AM".  This is to be expected 
since I used UN_TOKENIZED, correct?

How do I go about searching for 1) StartDate with the exact starting date 2) A 
range?

1) StartDate:"2/21/2009 12:00:00AM"
This doesn't even find the exact entry.  Not sure what's going on here.

2) StartDate:[2/21/2009 TO 2/24/2009]
StartDate:[2009/2/21 TO 2009/2/24]

None of the above works...can someone point out how I should be handling this?  
From indexing to the search query...

Thanks.

Reply via email to