FAQ
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

Search Discussions

  • Michael McCandless at Jul 30, 2010 at 6:11 pm
    Nice catch -- thanks! I will fix.

    Mike

    On Fri, Jul 30, 2010 at 11:20 AM, jayendra patil
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJul 30, '10 at 3:21p
activeJul 30, '10 at 6:11p
posts2
users2
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase