Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
It seems that if you try to use a SpanNear query as the "exclude" argument to a SpanNot query, you encounter an NPE. The stack trace looks like the following (as of trunk r398639) ...
[junit] java.lang.NullPointerException
[junit] at org.apache.lucene.search.spans.NearSpans.doc(NearSpans.java:227)
[junit] at org.apache.lucene.search.spans.SpanNotQuery$1.next(SpanNotQuery.java:85)
[junit] at org.apache.lucene.search.spans.SpanScorer.next(SpanScorer.java:51)
[junit] at org.apache.lucene.search.Scorer.score(Scorer.java:47)
[junit] at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:132)
patch to TestBasics demonstrating bug will be attached shortly. I believe the problem is that SpanNotQuery$1 is calling "excludeSpans.doc()" without ever calling "excludeSpans.next()" ... this "works" when the exclude query is a TermQuery becuase the value returned by doc() is -1 ... but with SpanNearQuery tries to pop the initial value off of a queue which hasn't been initialized yet.
Attachments
Attachments
Issue Links
- duplicates
-
LUCENE-352 [PATCH] NullPointerException when using nested SpanOrQuery in SpanNotQuery
- Closed