Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9
    • Component/s: core/other
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      This is a followup to LUCENE-1836: I found some more Locale problems in Lucene with Date Formats. Even for simple date formats only consisting of numbers (like ISO dates), you should always give the US locale. Because the dates in DateTools should sort according to String.compare(), it is important, that the decimal digits are western ones. In some strange locales, this may be different. Whenever you want to format dates for internal formats you exspect to behave somehow, you should at least set the locale to US, which uses ASCII. Dates entered by users and displayed to users, should be formatted according to the default or a custom specified locale.
      I also looked for DecimalFormat (especially used for padding numbers), but found no problems.

      1. LUCENE-1846.patch
        4 kB
        Uwe Schindler

        Issue Links

          Activity

          Hide
          Uwe Schindler added a comment -

          Committed Calendar fix in:
          trunk revision 1063501
          3.x revision: 1063502
          3.0 revision: 1063506
          2.9 revision: 1063509

          Show
          Uwe Schindler added a comment - Committed Calendar fix in: trunk revision 1063501 3.x revision: 1063502 3.0 revision: 1063506 2.9 revision: 1063509
          Hide
          Uwe Schindler added a comment -

          In DateTools is another bug:
          The Calendar used is not always the Gregorian one (e.g. if default Locale is Thai). We should also pass Locale.US to the Calendar.getInstance() call.

          Show
          Uwe Schindler added a comment - In DateTools is another bug: The Calendar used is not always the Gregorian one (e.g. if default Locale is Thai). We should also pass Locale.US to the Calendar.getInstance() call.
          Hide
          Uwe Schindler added a comment -

          Committed revision: 807117

          Show
          Uwe Schindler added a comment - Committed revision: 807117
          Hide
          Robert Muir added a comment -

          Uwe, thanks for bringing this issue up!

          we still have more work to do. Out of curiosity, i looked to see if the old queryparser in core passed under korean locale.
          it does not...

          setenv ANT_ARGS "-Dargs=-Duser.language=ko -Duser.country=KR"
          ant -Dtestcase=TestQueryParser test
          
          Show
          Robert Muir added a comment - Uwe, thanks for bringing this issue up! we still have more work to do. Out of curiosity, i looked to see if the old queryparser in core passed under korean locale. it does not... setenv ANT_ARGS "-Dargs=-Duser.language=ko -Duser.country=KR" ant -Dtestcase=TestQueryParser test
          Hide
          Uwe Schindler added a comment - - edited

          Patch.

          The changes in DateTools may affect users with very strange default locales that indexed with prior Lucene versions, but this is unlikely a problem, as the whole sorting may be broken already.

          Should I add a note to CHANGES.txt?

          Show
          Uwe Schindler added a comment - - edited Patch. The changes in DateTools may affect users with very strange default locales that indexed with prior Lucene versions, but this is unlikely a problem, as the whole sorting may be broken already. Should I add a note to CHANGES.txt?

            People

            • Assignee:
              Uwe Schindler
              Reporter:
              Uwe Schindler
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development