One of the engineers decided to remove that exception to see what effect it had on our particular troubling query:

Index: src/java/org/apache/lucene/search/spans/NearSpans.java
===================================================================
--- src/java/org/apache/lucene/search/spans/NearSpans.java (revision 372606) +++ src/java/org/apache/lucene/search/spans/NearSpans.java (working copy)
@@ -288,7 +288,8 @@
// When queue is empty and checkSlop() and ordered there is a match.
      }
    }
-    throw new RuntimeException("Unexpected: ordered");
+    //throw new RuntimeException("Unexpected: ordered");
+    return false;
  }

  private void listToQueue() {


And the error with that query went away and the results were accurate.

I realize this isn't the long-term fix, but wanted to report where things stand.

I'm still going to patch things up locally with those JIRA patches and see where that takes it. We've not had success building a generic index that we can share that duplicates this issue, unfortunately.

        Erik





On Jan 25, 2006, at 6:14 AM, Erik Hatcher wrote:

In using SpanQuery in a sophisticated way, we've experienced an issue with NearSpans giving the following exception:

java.lang.RuntimeException: Unexpected: ordered
at org.apache.lucene.search.spans.NearSpans.firstNonOrderedNextToPartialL ist(NearSpans.java:291) at org.apache.lucene.search.spans.NearSpans.next (NearSpans.java:183) at org.apache.lucene.search.spans.SpanScorer.next (SpanScorer.java:50) at org.apache.lucene.search.BooleanScorer$SubScorer.<init> (BooleanScorer.java:48) at org.apache.lucene.search.BooleanScorer.add (BooleanScorer.java:76) at org.apache.lucene.search.BooleanQuery$BooleanWeight.scorer (BooleanQuery.java:274) at org.apache.lucene.search.IndexSearcher.search (IndexSearcher.java:98)
       at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65)
       at org.apache.lucene.search.Hits.<init>(Hits.java:44)
       at org.apache.lucene.search.Searcher.search(Searcher.java:44)
       at org.apache.lucene.search.Searcher.search(Searcher.java:36)

This is using the current trunk code. I believe this may be related to http://issues.apache.org/jira/browse/LUCENE-413

Unfortunately I cannot share the exact index or query, but the query ends up being a BooleanQuery with about 10 clauses, some being simple TermQuery's, and others being SpanNearQuery's nested with SpanRegexQuery's and SpanTermQuery's.

Thoughts? Is this related to LUCENE-413? Shall I re-apply all those patches (if they still work) and give it another try?

        Erik


---------------------------------------------------------------------
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