Karl, 

On Tuesday 18 April 2006 17:48, karl wettin wrote:
> I don't understand what it means when this exception is thrown. I'm  
> quite certain that it is my skipTo(target)-code that causes it , but  
> I don't understand why. The FIXME and error message makes me think it  
> might be that I deliver the data ordered and it was not expected to be?

Although it fixed another bug at the time, the line throwing the exception 
is actually unfinished code. There are two ways to improve this:
- use the NearSpans...  code and the patch for SpanNearQuery from here:
http://issues.apache.org/jira/browse/LUCENE-413
The NearSpansOrdered there is a bit restrictive in that it does not match
spans that have indexed positions in common.
- delete the line throwing the exception. Iirc, there was a report that this 
could work, but I don't know what the method should return in that case.

Also, the skipTo() methods in SpanScorer and DisjunctionSumScorer were
recently changed at the same LUCENE-413 issue.

Regards,
Paul Elschot




> private boolean firstNonOrderedNextToPartialList() throws IOException {
>      /* Creates a partial list consisting of first non ordered and  
> earlier.
>       * Returns first non ordered .next().
>       */
>      last = first = null;
>      int orderedIndex = 0;
>      while (queue.top() != null) {
>        SpansCell cell = (SpansCell)queue.pop();
>        addToList(cell);
>        if (cell.index == orderedIndex) {
>          orderedIndex++;
>        } else {
>          return cell.next();
>          // FIXME: continue here, rename to eg. checkOrderedMatch():
>          // when checkSlop() and not ordered, repeat cell.next().
>          // when checkSlop() and ordered, add to list and repeat  
> queue.pop()
>          // without checkSlop(): no match, rebuild the queue from the  
> partial list.
>          // When queue is empty and checkSlop() and ordered there is  
> a match.
>        }
>      }
>      throw new RuntimeException("Unexpected: ordered");
>    }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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

Reply via email to