[ http://issues.apache.org/jira/browse/LUCENE-413?page=all ]

paul.elschot updated LUCENE-413:
--------------------------------

    Attachment: SpanScorer.java
                TestSpansAdvanced.java
                TestSpansAdvanced2.java

I think I found a bug in SpanScorer.java.

The problem is that SpanScorer.skipTo() and SpanScorer.next() are not
designed to be used both in the same search.
As the doc of the scored Spans is normally ahead, the attached version of
SpanScorer adds a check in skipTo() for the scored spans not being ahead
of the target of skipTo().
The attached version of SpanScorer is also refactored to remove double code.

This new SpanScorer changes the behaviour of SpanQueries and it leaves
TestSpansAdvanced and TestSpansAdvanced2 failing. I attached a passing version 
for both of these tests, but they still contain some System.out.println()'s,
and the test for the score value is changed to a warning. The same documents
still match in the tests, only some score values change.

I don't know whether DisjunctionSumScorerPatch5.txt is still needed, but it 
should not hurt.

I didn't change the copyright year in the sources, in case they make it
to the trunk, the year could be updated.



> [PATCH] BooleanScorer2 ArrayIndexOutOfBoundsException + alternative NearSpans
> -----------------------------------------------------------------------------
>
>          Key: LUCENE-413
>          URL: http://issues.apache.org/jira/browse/LUCENE-413
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>  Environment: Operating System: other
> Platform: Other
>     Reporter: paul.elschot
>     Assignee: Lucene Developers
>  Attachments: DisjunctionSumScorerPatch3.txt, DisjunctionSumScorerPatch4.txt, 
> DisjunctionSumScorerPatch5.txt, DisjunctionSumScorerTestPatch1.txt, 
> NearSpansOrdered.java, NearSpansOrderedBugHuntPatch1.txt, 
> NearSpansUnordered.java, SpanNearQueryPatch1.txt, SpanScorer.java, 
> SpanScorerTestPatch1.txt, TestSpansAdvanced.java, TestSpansAdvanced2.java
>
> From Erik's post at java-dev: 
>  
> >      [java] Caused by: java.lang.ArrayIndexOutOfBoundsException: 4 
> >      [java]     at org.apache.lucene.search.BooleanScorer2  
> > $Coordinator.coordFactor(BooleanScorer2.java:54) 
> >      [java]     at org.apache.lucene.search.BooleanScorer2.score  
> > (BooleanScorer2.java:292) 
> ... 
>  
> and my answer: 
>  
> Probably nrMatchers is increased too often in score() by calling score() 
> more than once.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to