lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (LUCENE-1836) Flexible QueryParser fails with local different from en_US
Date Mon, 24 Aug 2009 14:54:59 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746897#action_12746897
] 

Robert Muir edited comment on LUCENE-1836 at 8/24/09 7:53 AM:
--------------------------------------------------------------

Uwe, i undid my change for curiousity : the issue was not DateTools, but i still believe it
was an overflow

or the other more likely possibility is since the date in the test (2002 in Thai calendar)
is really 1459 in the gregorian calendar, you get negative time :)

{noformat}
java.lang.RuntimeException: time '-16122135600000' is too early, must be >= 0
	at org.apache.lucene.document.DateField.timeToString(DateField.java:95)
	at org.apache.lucene.document.DateField.dateToString(DateField.java:86)
	at org.apache.lucene.queryParser.standard.TestQPHelper.getLegacyDate(TestQPHelper.java:633)
	at org.apache.lucene.queryParser.standard.TestQPHelper.testLegacyDateRange(TestQPHelper.java:683)
	...
{noformat}

But I agree, we should be consistent about use of GregorianCalendar and I think the patch
is correct in that sense.


      was (Author: rcmuir):
    Uwe, i undid my change for curiousity : the issue was not DateTools, but i still believe
it was an overflow

{noformat}
java.lang.RuntimeException: time '-16122135600000' is too early, must be >= 0
	at org.apache.lucene.document.DateField.timeToString(DateField.java:95)
	at org.apache.lucene.document.DateField.dateToString(DateField.java:86)
	at org.apache.lucene.queryParser.standard.TestQPHelper.getLegacyDate(TestQPHelper.java:633)
	at org.apache.lucene.queryParser.standard.TestQPHelper.testLegacyDateRange(TestQPHelper.java:683)
	...
{noformat}

But I agree, we should be consistent about use of GregorianCalendar and I think the patch
is correct in that sense.

  
> Flexible QueryParser fails with local different from en_US
> ----------------------------------------------------------
>
>                 Key: LUCENE-1836
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1836
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Uwe Schindler
>            Assignee: Luis Alves
>             Fix For: 2.9
>
>         Attachments: LUCENE-1836.patch, LUCENE-1836.patch, LUCENE-1836.patch, LUCENE-1836.patch
>
>
> I get the following error during the mentioned testcases on my computer, if I use the
Locale de_DE (windows 32):
> {code}
>     [junit] Testsuite: org.apache.lucene.queryParser.standard.TestQPHelper
>     [junit] Tests run: 29, Failures: 1, Errors: 0, Time elapsed: 1,156 sec
>     [junit]
>     [junit] ------------- Standard Output ---------------
>     [junit] Result: (fieldX:xxxxx fieldy:xxxxxxxx)^2.0
>     [junit] ------------- ---------------- ---------------
>     [junit] Testcase: testLocalDateFormat(org.apache.lucene.queryParser.standard.TestQPHelper):
FAILED
>     [junit] expected:<1> but was:<0>
>     [junit] junit.framework.AssertionFailedError: expected:<1> but was:<0>
>     [junit]     at org.apache.lucene.queryParser.standard.TestQPHelper.assertHits(TestQPHelper.java:1148)
>     [junit]     at org.apache.lucene.queryParser.standard.TestQPHelper.testLocalDateFormat(TestQPHelper.java:1005)
>     [junit]     at org.apache.lucene.util.LuceneTestCase.runTest(LuceneTestCase.java:201)
>     [junit]
>     [junit]
>     [junit] Test org.apache.lucene.queryParser.standard.TestQPHelper FAILED
>     [junit] Testsuite: org.apache.lucene.queryParser.standard.TestQueryParserWrapper
>     [junit] Tests run: 27, Failures: 1, Errors: 0, Time elapsed: 1,219 sec
>     [junit]
>     [junit] ------------- Standard Output ---------------
>     [junit] Result: (fieldX:xxxxx fieldy:xxxxxxxx)^2.0
>     [junit] ------------- ---------------- ---------------
>     [junit] Testcase: testLocalDateFormat(org.apache.lucene.queryParser.standard.TestQueryParserWrapper):
      FAILED
>     [junit] expected:<1> but was:<0>
>     [junit] junit.framework.AssertionFailedError: expected:<1> but was:<0>
>     [junit]     at org.apache.lucene.queryParser.standard.TestQueryParserWrapper.assertHits(TestQueryParserWrapper.java:1120)
>     [junit]     at org.apache.lucene.queryParser.standard.TestQueryParserWrapper.testLocalDateFormat(TestQueryParserWrapper.java:985)
>     [junit]     at org.apache.lucene.util.LuceneTestCase.runTest(LuceneTestCase.java:201)
>     [junit]
>     [junit]
>     [junit] Test org.apache.lucene.queryParser.standard.TestQueryParserWrapper FAILED
> {code}
> With en_US as locale it works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message