Description
DateRangeField has some issues for dates before 1582 (the Gregorian Change Date), following Solr 6. The main problem is that it uses DateMathParser which no longer observes a GCD and then it converts that Date to a Calendar using Calendar.setTime(date) which considers the GCD. We can't altogether avoid Calendar.java as in SOLR-9080 because DateRangePrefixTree currently fundamentally depends on it. However I recently learned we can simply change the GCD like so: cal.setGregorianChange(new Date(Long.MIN_VALUE)); beforehand. DateRangeField also calls Calendar.getTime as well, which is affected by GCD considerations.
For users that use DateRangeField but do not use "Date Math" and do not have 'Z' in their date strings then date strings are completely parsed by DateRangePrefixTree and there should be no issue.
DateRangePrefixTree ought to be improved a bit too (in a separate issue)... like making the GCD configurable, and setting using SimpleDateFormatter.setCalendar it uses to format.
Attachments
Attachments
Issue Links
- is related to
-
SOLR-9080 DateMath is broken before the year 1582
- Closed
- requires
-
LUCENE-7278 Make template Calendar configurable in DateRangePrefixTree
- Closed