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 Bill Tschumy <bi...@otherwise.com> on 2005/04/13 21:20:58 UTC

ArrayIndexOutOfBounds exception

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org