lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armbrust, Daniel C." <>
Subject RE: Date can't be before 1970?
Date Thu, 07 Nov 2002 19:16:35 GMT
You can also still use a date filter... You just have to write your own (this is what we did)

Its basically a copy of the current date filter... With a couple of minor changes.


-----Original Message-----
From: Peter Carlson [] 
Sent: Monday, November 04, 2002 12:06 AM
To: Lucene Users List
Subject: Re: Date can't be before 1970?

The other option that some people have used is to not use the DateField 
and just create your own format following the
yyyyMMdd format

So 20020101 for Jan 1, 2002

Note that you cannot use the Date Filter to filter dates.

However you can use the built in range query (see query syntax for more 

So to search for all dates in 2002 in the pubDate field you can use

pubDate:[20020101 - 20021231]

Note the space on either side of the dash (-).

Since this is just a string, it is not affected by the 1970 issues. I 
hope this helps.


On Sunday, November 3, 2002, at 10:01 PM, Herman Chen wrote:

> Hi,
> I noticed that DateField.dateToString does not allow dates before
> 1970.  Is the limitation caused by java's Date or by the way it needs 
> to be encoded for the index.  What is the suggested solution to deal 
> with dates prior to 1970?  Thanks.
> --
> Herman

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message