Erik Hatcher wrote: > On May 11, 2004, at 7:41 PM, Glen Stampoultzis wrote: > > Is it possible to use float and date ranges in that case? Or maybe I > > should > > just read the details in the manual and stop asking stupid questions. > > > > :-) > > Terms in the index are *always* text. The DateField class in Lucene > helps do conversions, but see the wiki for more info on date fields. I > wouldn't recommend using it, personally, unless millisecond granularity > is really desired.
For date handling and querying we munge the datetime in seconds to be a lexicographically ordered value, but the standard YYYYMMDDHHMMSS string format is just as good. Because in our app people are generally interested in day granularity rather than seconds for date-range querying, we index on a date value and use that field for queries. However for subsequent sorting we have a full datetime value which is a stored Lucene field. Since we index about 1,000 articles per day, this means the boolean term expansion, based on the date, is at an acceptable level (in the 10's usually) whereas trying to utilize the datetime field for that would generally require 1,000x more and cause resource problems. Cheers, Paul. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
