lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russ" <rsi...@istandfor.com>
Subject Re: An arguable bug in Lucene 1.9.1
Date Wed, 07 Feb 2007 13:56:41 GMT
You're not Gary Lee that went to poly, are you?
Sent wirelessly via BlackBerry from T-Mobile.  

-----Original Message-----
From: Lee_Gary@emc.com
Date: Mon, 5 Feb 2007 19:38:03 
To:<java-user@lucene.apache.org>
Subject: RE: An arguable bug in Lucene 1.9.1

I am seeing this issue as well with the exact same stack trace using
spanQueries. Does anyone know if this has been fixed for versions after
1.9.1?

Thanks
Gary 

-----Original Message-----
From: Erick Erickson [mailto:erickerickson@gmail.com] 
Sent: Tuesday, May 23, 2006 07:23 AM
To: java-user@lucene.apache.org
Subject: An arguable bug in Lucene 1.9.1

I'm constructing a BooleanQuery across several fields with
SpanNearQuerys.
In the degenerate case of spanning *one* term, AND adding a non-span
clause, I get an exception thrown. Of course you can argue that a span
query over one term is silly and shouldn't be done, but I thought I'd
mention this. I'm content with whatever y'all decide.

Here's the results of a BooleanQuery.toString:

+(spanNear([person:john], 20, false) spanNear([text:john], 5, false))
+groupid:14075

This results in the following stack trace:

ava.lang.ArrayIndexOutOfBoundsException: 4
    at org.apache.lucene.search.BooleanScorer2$Coordinator.coordFactor(
BooleanScorer2.java:54)
    at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java
:328)
    at org.apache.lucene.search.ConjunctionScorer.score(
ConjunctionScorer.java:82)
    at
org.apache.lucene.search.BooleanScorer2$2.score(BooleanScorer2.java
:186)
    at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java
:327)
    at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java
:291)
    at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:132)
    at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:110)
    at org.apache.lucene.search.Searcher.search(Searcher.java:76)
   ****my code here

If I take off the end clause, or have more than one string in the span,
it works. e.g.

+(spanNear([person:john], 20, false) spanNear([text:john], 5, false))

works, as does:

+(spanNear([person:john, person:johnson], 20, false) 
+spanNear([text:john,
text:johnson], 5, false)) +groupid:14075

Of course I can (and will) intercept the creation of the span queries
when there is only one term and use TermQuery instead. I suspect that
this is better practice anyway.

I'll be happy to enter this in bugs database if you think I should.

Best
Erick

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Mime
View raw message