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 Ramana Jelda <ra...@ciao-group.com> on 2006/03/28 18:29:36 UTC

BooleanQuery containing SpanNearQuery throws ArrayOutOfBoundsException .

Hi,
I have a got strange problem.
My searchterm : "mp3 player"
Lucene Query : 
+(
  +(
    spanNear([productName:mp, productName:3], 3, true) 
    spanNear([subName:mp, subName:3], 3, true)
   ) 
 +(productName:player subName:player)
)

Throws following lucene BooleanScorer2 exception.
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
	at
org.apache.lucene.search.BooleanScorer2$Coordinator.coordFactor(BooleanScore
r2.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)


I tried to look at forums and JIRA issues. It seems somewhat it is releated
to https://issues.apache.org/jira/browse/LUCENE-413 issue.
At the same time if I search for "gx3 minolta" which makes a lucene query as
+(
 +(
   spanNear([productName:gx, productName:3], 3, true) 
   spanNear([subName:gx, subName:3], 3, true)
  )
 +(productName:minolta subName:minolta)
)
Works fine without any problems.

Does anyone encountered similar problem.
Do I totally ignore span queries and switch back to phrasequeries (which
ofcourse not ordered & a drawback for our search)


Jelda


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


Re: BooleanQuery containing SpanNearQuery throws ArrayOutOfBoundsException .

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

I have just added a patch for DisjunctionSumScorer.java here:
https://issues.apache.org/jira/browse/LUCENE-413 issue.

Could you try that patch and report the results at the jira issue?

In case you need help using the patch could you move the
discussion to the java-dev list?

Regards,
Paul Elschot

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


RE: BooleanQuery containing SpanNearQuery throws ArrayOutOfBoundsException .

Posted by Ramana Jelda <ra...@ciao-group.com>.
Thanks for your reply.
For smaller index it is working fine.
I will try again and again to reproduce exception.

Please let me know, if there is a quick fix to do locally.

Thanks & Regards,
Jelda

> -----Original Message-----
> From: Paul Elschot [mailto:paul.elschot@xs4all.nl] 
> Sent: Tuesday, March 28, 2006 11:12 PM
> To: java-user@lucene.apache.org
> Subject: Re: BooleanQuery containing SpanNearQuery throws 
> ArrayOutOfBoundsException .
> 
> Comments inline below.
> 
> On Tuesday 28 March 2006 18:29, Ramana Jelda wrote:
> > 
> > Hi,
> > I have a got strange problem.
> > My searchterm : "mp3 player"
> > Lucene Query : 
> > +(
> >   +(
> >     spanNear([productName:mp, productName:3], 3, true) 
> >     spanNear([subName:mp, subName:3], 3, true)
> >    )
> >  +(productName:player subName:player)
> > )
> > 
> > Throws following lucene BooleanScorer2 exception.
> > Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
> > 	at
> > 
> org.apache.lucene.search.BooleanScorer2$Coordinator.coordFactor(Boolea
> > nScore
> > r2.java:54)
> > 	at
> > 
> org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java:328)
> > 	at
> > 
> org.apache.lucene.search.ConjunctionScorer.score(ConjunctionSc
> orer.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)
> > 
> > 
> > I tried to look at forums and JIRA issues. It seems somewhat it is 
> > releated to https://issues.apache.org/jira/browse/LUCENE-413 issue.
> 
> That seems to be the case indeed.
> Would it be possible for you to provide a (preferably small) 
> lucene index that shows this problem?
> When so, could you post it at the jira issue?
> 
> > At the same time if I search for "gx3 minolta" which makes a lucene 
> > query as
> > +(
> >  +(
> >    spanNear([productName:gx, productName:3], 3, true) 
> >    spanNear([subName:gx, subName:3], 3, true)
> >   )
> >  +(productName:minolta subName:minolta)
> > )
> > Works fine without any problems.
> 
> Similar strange behaviour occurred on the previous occasion.
> 
> > Does anyone encountered similar problem.
> > Do I totally ignore span queries and switch back to phrasequeries 
> > (which ofcourse not ordered & a drawback for our search)
> 
> You might try the alternative implementation of span queries 
> that is available at the jira issue. However, even with that, 
> the problem persisted on the previous occasion, so the source 
> of the problem seems to be somewhere else.
> This is also why a test index would be most welcome.
> 
> Regards,
> Paul Elschot
> 
> ---------------------------------------------------------------------
> 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: BooleanQuery containing SpanNearQuery throws ArrayOutOfBoundsException .

Posted by Paul Elschot <pa...@xs4all.nl>.
Comments inline below.

On Tuesday 28 March 2006 18:29, Ramana Jelda wrote:
> 
> Hi,
> I have a got strange problem.
> My searchterm : "mp3 player"
> Lucene Query : 
> +(
>   +(
>     spanNear([productName:mp, productName:3], 3, true) 
>     spanNear([subName:mp, subName:3], 3, true)
>    ) 
>  +(productName:player subName:player)
> )
> 
> Throws following lucene BooleanScorer2 exception.
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
> 	at
> org.apache.lucene.search.BooleanScorer2$Coordinator.coordFactor(BooleanScore
> r2.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)
> 
> 
> I tried to look at forums and JIRA issues. It seems somewhat it is releated
> to https://issues.apache.org/jira/browse/LUCENE-413 issue.

That seems to be the case indeed.
Would it be possible for you to provide a (preferably small) lucene index that
shows this problem?
When so, could you post it at the jira issue?

> At the same time if I search for "gx3 minolta" which makes a lucene query as
> +(
>  +(
>    spanNear([productName:gx, productName:3], 3, true) 
>    spanNear([subName:gx, subName:3], 3, true)
>   )
>  +(productName:minolta subName:minolta)
> )
> Works fine without any problems.

Similar strange behaviour occurred on the previous occasion.

> Does anyone encountered similar problem.
> Do I totally ignore span queries and switch back to phrasequeries (which
> ofcourse not ordered & a drawback for our search)

You might try the alternative implementation of span queries that is available
at the jira issue. However, even with that, the problem persisted on the 
previous occasion, so the source of the problem seems to be somewhere else.
This is also why a test index would be most welcome.

Regards,
Paul Elschot

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