You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Le...@emc.com on 2007/02/06 01:38:03 UTC

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


Re: An arguable bug in Lucene 1.9.1

Posted by Paul Elschot <pa...@xs4all.nl>.
Gentlemen,

Have a look here:
https://issues.apache.org:443/jira/browse/LUCENE-413
This was fixed in 2.0. 

Regards,
Paul Elschot




On Tuesday 06 February 2007 01:38, Lee_Gary@emc.com wrote:
> 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
> 
> 
> 
> 

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


Re: An arguable bug in Lucene 1.9.1

Posted by Russ <rs...@istandfor.com>.
Sorry, didn't mean for this to go to the list...  

Russ
Sent wirelessly via BlackBerry from T-Mobile.  

-----Original Message-----
From: "Russ" <rs...@istandfor.com>
Date: Wed, 7 Feb 2007 13:56:41 
To:java-user@lucene.apache.org
Subject: Re: An arguable bug in Lucene 1.9.1

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:<ja...@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

Re: An arguable bug in Lucene 1.9.1

Posted by Russ <rs...@istandfor.com>.
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:<ja...@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