I found that the current code in CVS prevents a org.apache.lucene.search.DateFilter from functioning properly.

This fragment is taken from org.apache.lucene.document.DateField


// Pad with leading zeros
if (s.length() < DATE_LEN) {
StringBuffer sb = new StringBuffer(s);
while (sb.length() < DATE_LEN)
sb.insert(0, ' ');
s = sb.toString();
}


The code is padding ' ' (space) instead of zeros.

Line 5 should be: sb.insert(0, '0');

Making this change and recompiling gave the expected results.

Looking back, the lucene-1.2 source uses the following fragment:

while (s.length() < DATE_LEN)
s = "0" + s; // pad with leading zeros





_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to