: We have big problem searching out solr index and filtering for the date. 
: Let me give you an example: there is a record with date 30.04.2008, 
: 15:32:00. My query contains "+date:[20080101T12:00:00Z TO 
: 20080915T13:59:00Z]" but the record is not found. But when I search 
: "+date:[20071231T12:00:00Z TO 20080915T13:59:00Z]" the record is found.

I'm not sure what version of Solr you are using, but those are not legal 
date strings for DateField, so it doesn't suprise me that you might be 
getting weird behavior when searching.

In Solr 1.2, Solr didn't generate an error if you attempted to index a 
malformed date value.  In particular: any value that ended with a "Z" 
was consitered fair game and indexed "as is".  As long as you only 
attempted to index values according to the spec, you'd be fine, but if 
you've been indexing values like 20080101T12:00:00Z instead of 
2008-01-01T12:00:00Z in Solr 1.2 they may not sort properly -- which means 
range queries may not work properly either.


This has been fixed in 1.3, and the The release notes go into great depth 
about this... 

In Solr 1.2, DateField did not enforce the canonical representation of
the ISO 8601 format when parsing incoming data, and did not generation
the canonical format when generating dates from "Date Math" strings
(particularly as it pertains to milliseconds ending in trailing zeros)
-- As a result equivalent dates could not always be compared properly.
This problem is corrected in Solr 1.3, but DateField users that might
have been affected by indexing inconsistent formats of equivilent
dates (ie: 1995-12-31T23:59:59Z vs 1995-12-31T23:59:59.000Z) may want
to consider reindexing to correct these inconsistencies.  Users who
depend on some of the the "broken" behavior of DateField in Solr 1.2
(specificly: accepting any input that ends in a 'Z') should consider
using the LegacyDateField class as a possible alternative.  Users that
desire 100% backwards compatibility should consider using the Solr 1.2
version of DateField.

        ...

29. SOLR-470, SOLR-552, SOLR-544, SOLR-701: Multiple fixes to DateField
    regarding lenient parsing of optional milliseconds, and correct
    formating using the canonical representation.  LegacyDateField has
    been added for people who have come to depend on the existing
    broken behavior. (hossman, Stefan Oestreicher)




-Hoss

Reply via email to