On Thu, Feb 3, 2011 at 12:19 PM, Robert Muir <rcmuir@gmail.com> wrote:
> can you please backport to branch_3x too? there are the same problems
> there, including a test method in TestSort that i had to completely
> @Ignore!
I will check that - but it seems that if we go for a different default
in TopDocs#maxScore we should be fine. Can we do that on 3.x without
breaking anything - seems reasonable..
>
> On Thu, Feb 3, 2011 at 4:11 AM, Simon Willnauer
> <simon.willnauer@googlemail.com> wrote:
>> committed a fix in revision 1066764
>>
>> simon
>>
>> On Thu, Feb 3, 2011 at 9:35 AM, Simon Willnauer
>> <simon.willnauer@googlemail.com> wrote:
>>> Seems like we don't respect segments that don't return hits for a
>>> certain query....
>>>
>>> Index: lucene/src/java/org/apache/lucene/search/IndexSearcher.java
>>> ===================================================================
>>> --- lucene/src/java/org/apache/lucene/search/IndexSearcher.java (revision
>>> 1066751)
>>> +++ lucene/src/java/org/apache/lucene/search/IndexSearcher.java (working copy)
>>> @@ -373,8 +373,10 @@
>>> int totalHits = 0;
>>> float maxScore = Float.NEGATIVE_INFINITY;
>>> for (final TopDocs topDocs : runner) {
>>> - totalHits += topDocs.totalHits;
>>> - maxScore = Math.max(maxScore, topDocs.getMaxScore());
>>> + if(topDocs.totalHits != 0) {
>>> + totalHits += topDocs.totalHits;
>>> + maxScore = Math.max(maxScore, topDocs.getMaxScore());
>>> + }
>>> }
>>>
>>> final ScoreDoc[] scoreDocs = new ScoreDoc[hq.size()];
>>> @@ -451,8 +453,10 @@
>>> int totalHits = 0;
>>> float maxScore = Float.NEGATIVE_INFINITY;
>>> for (final TopFieldDocs topFieldDocs : runner) {
>>> - totalHits += topFieldDocs.totalHits;
>>> - maxScore = Math.max(maxScore, topFieldDocs.getMaxScore());
>>> + if (topFieldDocs.totalHits != 0) {
>>> + totalHits += topFieldDocs.totalHits;
>>> + maxScore = Math.max(maxScore, topFieldDocs.getMaxScore());
>>> + }
>>> }
>>> final ScoreDoc[] scoreDocs = new ScoreDoc[hq.size()];
>>> for (int i = hq.size() - 1; i >= 0; i--) // put docs in array
>>>
>>>
>>> the tests pass if I check the number of hits though - I will commit in a second
>>>
>>> simon
>>>
>>> On Thu, Feb 3, 2011 at 6:09 AM, Apache Hudson Server
>>> <hudson@hudson.apache.org> wrote:
>>>> Build: https://hudson.apache.org/hudson/job/Lucene-Solr-tests-only-trunk/4442/
>>>>
>>>> 1 tests failed.
>>>> REGRESSION: org.apache.lucene.search.payloads.TestPayloadTermQuery.test
>>>>
>>>> Error Message:
>>>> NaN does not equal: 1
>>>>
>>>> Stack Trace:
>>>> junit.framework.AssertionFailedError: NaN does not equal: 1
>>>> at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:1183)
>>>> at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:1115)
>>>> at org.apache.lucene.search.payloads.TestPayloadTermQuery.test(TestPayloadTermQuery.java:149)
>>>>
>>>>
>>>>
>>>>
>>>> Build Log (for compile errors):
>>>> [...truncated 2961 lines...]
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>>>> For additional commands, e-mail: dev-help@lucene.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
|