I am using the MoreLikeThis class that is available in the "similarity" package in the contributed software area. It has bee working fine, but I just received the following exception

java.lang.ArrayIndexOutOfBoundsException: -1
at org.apache.lucene.index.MultiReader.getTermFreqVector(MultiReader.java: 89)
at org.apache.lucene.search.similar.MoreLikeThis.retrieveTerms(MoreLikeThis .java:675)
at org.apache.lucene.search.similar.MoreLikeThis.like(MoreLikeThis.java: 452)
at com.otherwise.parsnips.MySearcher.getMoreLikeThis(MySearcher.java:236)
at com.otherwise.parsnips.Parsnips.showMoreLikeThis(Parsnips.java:1326)
...


Here is the offending code in getTermFreqVector:

  public TermFreqVector getTermFreqVector(int n, String field)
      throws IOException {
    int i = readerIndex(n);        // find segment num
    return subReaders[i].getTermFreqVector(n - starts[i], field);
  }

That index "i" returned from readerIndex() is -1.

I have gotten it twice, but am now unable to reproduce it. Does anyone know if there is a known problem or what I might do to prevent it?

--
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to