lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Storing dates as longs
Date Mon, 28 Jun 2004 23:07:42 GMT
On Jun 28, 2004, at 11:17 AM, Kevin Burton wrote:
> Otis Gospodnetic wrote:
>
>> Hello,
>>
>> The standard answer to this question is:
>> If you don't need your dates to be very precise, trim milliseconds. 
>> Trim more (e.g. seconds) if that information is not relevant.
>>
>>
> So the question is should use store this data in the lucene date field 
> or as millis with padding...
>
> We have the same issue.

It all depends on what granularity you care about.  If your application 
only cares about year, month, and day, then I recommend indexing dates 
literally as text YYYYMMDD format, which allows you to query by year 
(or year and month, or year, month, and day) quite efficiently.

If you care about milliseconds, you will need to determine how best to 
handle this when it comes to querying.  A RangeQuery on tons of 
documments that all within the date range is an issue that deserves 
consideration and you may need to do some cached filters in order to 
facilitate such things.

	Erik


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