On Sunday 03 July 2005 15:27, Dave Kor wrote: > I have a system that automatically generate span queries to Lucene. Sometimes, > the system generates a query like this one which always throws a > RuntimeException: > > spanNear([spanNear([text:interesting], 3, true), spanNear([text:interesting, > text:john, text:said], 8, true)], 2, true) > > Basically, the system is looking for a document that contains a string sequence > "interesting .... interesting john said". The thrown exception is as follows: > > java.lang.RuntimeException: Unexpected: ordered > at > org.apache.lucene.search.spans.NearSpans.firstNonOrderedNextToPartialList(Unknown > Source) > at org.apache.lucene.search.spans.NearSpans.next(Unknown Source) > at org.apache.lucene.search.spans.SpanScorer.next(Unknown Source) > at org.apache.lucene.search.Scorer.score(Unknown Source) > at org.apache.lucene.search.IndexSearcher.search(Unknown Source) > > My question is, what does is this "Unexpected: ordered" mean? and is there > anyway I can avoid these exceptions?
It's an internal error that is not supposed to occur. Could you continue on the java-dev list? SpanNearQuery is not supposed to operate on a single argument, at least that's what I thought when I wrote the bug fix code that throws this exception. Does the exception go away when you replace the first spanNear (the one with the single [text:interesting] with a SpanTermQuery ? It's also possible that the code cannot handle the two identical text:interesting arguments. It's probably good to have a test case for this. Could you extend the exception with the document number and maybe a position within the document to try and get to the original text that causes this exception, and use that to file a bug report? Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]