lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Esme Cowles <>
Subject Dates before 1970
Date Mon, 16 Dec 2002 19:45:34 GMT
I recently ran across several of the postings to this list and lucene-user
about DateField not handling dates before 1970.  Some people suggested
encoding the dates using a YYYYMMDD scheme, or modifying DateField to
offset the dates by a few hundred years.

In the documents that I'm indexing, there are a lot of historical dates,
ranging back to 500 BCE or so.  Wanting a much larger date range led me to
expand on the offsetting approach: by offsetting the dates by 2^62 (half
of the max value of a positive long).  This allows dates roughly 150
million years in the past or future (which should handle everything except
astronomical and some geological dates).

In the limited performance tests that I did, there was no change in the
indexing or querying speeds.  Attached is a patch against v1.4 from CVS.

Esme Cowles <>, UCSD Libraries

"I know not with what weapons World War III will be fought, but World War IV
 will be fought with sticks and stones."  -- attributed to Albert Einstein

View raw message