lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: MultiPhraseQuery throws ArrayIndexOutOfBounds Exception
Date Fri, 30 Jul 2010 18:11:04 GMT
Nice catch -- thanks!  I will fix.

Mike

On Fri, Jul 30, 2010 at 11:20 AM, jayendra patil
<jayendra.patil@gmail.com> wrote:
> Working on the nightly build of solr and lucene -
>
> MultiPhraseQuery throws ArrayIndexOutOfBounds Exception for the words
> defined as synonyms
>
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: 5
>    at
> org.apache.lucene.search.MultiPhraseQuery$MultiPhraseWeight.scorer(MultiPhraseQuery.java:191)
>
>        if (terms.length > 1) {
>          postingsEnum = new UnionDocsAndPositionsEnum(reader, terms);
>
>          // coarse -- this overcounts since a given doc can
>          // have more than one terms:
>          docFreq = 0;
>          for(int j=0;j<terms.length;j++) {
>            // Should be j
>            docFreq += reader.docFreq(terms[*i*]);
>          }
>        } else {
>
> The for loop seems to iterate on terms length with variable j, but refers to
> i within the loop which is iterating on the search terms count.
>
> Regards,
> Jayendra
>

---------------------------------------------------------------------
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