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

Reply via email to