Fixed.
SimpleDateFormat needed it's timezone set to UTC in the test (it was
formatting in local time and sticking on a 'Z').


-Yonik
http://www.lucidimagination.com


On Sun, Mar 15, 2009 at 3:32 AM, Shalin Shekhar Mangar
<shalinman...@gmail.com> wrote:
> On Sat, Mar 14, 2009 at 1:49 PM, <solr-dev@lucene.apache.org> wrote:
>
>>
>>    [junit] Running org.apache.solr.TestTrie
>>    [junit] <response>
>>    [junit] <lst name="responseHeader"><int name="status">0</int><int
>> name="QTime">2</int></lst><result name="response" numFound="6"
>> start="0"><doc><float name="id">0.0</float><date
>> name="tdate">2009-03-14T00:00:00Z</date></doc><doc><float
>> name="id">1.0</float><date
>> name="tdate">2009-03-15T00:00:00Z</date></doc><doc><float
>> name="id">2.0</float><date
>> name="tdate">2009-03-16T00:00:00Z</date></doc><doc><float
>> name="id">3.0</float><date
>> name="tdate">2009-03-17T00:00:00Z</date></doc><doc><float
>> name="id">4.0</float><date
>> name="tdate">2009-03-18T00:00:00Z</date></doc><doc><float
>> name="id">5.0</float><date
>> name="tdate">2009-03-19T00:00:00Z</date></doc></result>
>>    [junit] </response>
>>    [junit] )
>>    [junit] Tests run: 7, Failures: 1, Errors: 0, Time elapsed: 7.421 sec
>>    [junit] Test org.apache.solr.TestTrie FAILED
>>
>
> Is anybody else seeing this test fail on their local box? It passes on my
> box.
>
> In case anybody is curious, I'm indexing 10 dates (NOW/DAY to NOW/DAY+9
> DAYS) and querying for tdate:[NOW/DAY TO NOW/DAY+5DAYS]. The bounds are
> supposed to inclusive so it should give 6 results. But I get only 5 on my
> local box but the hudson build returns 6. I'm not able to explain it.
>
> Here's the code for indexing:
>
> SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
>    assertU(delQ("*:*"));
>    DateMathParser dmp = new DateMathParser(DateField.UTC, Locale.US);
>    for (int i = 0; i < 10; i++) {
>      // index 10 days starting with today
>      assertU(adoc("id", String.valueOf(i), "tdate", format.format(i == 0 ?
> dmp.parseMath("/DAY") : dmp.parseMath("/DAY+" + i + "DAYS"))));
>    }
>    assertU(commit());
>
> Here's the test:
> req = req("q", "*:*", "fq", "tdate:[NOW/DAY TO NOW/DAY+5DAYS]");
> assertQ("Range filter must match only 5 documents", req,
> "//*...@numfound='5']");
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Reply via email to