lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Tschumy <b...@otherwise.com>
Subject ArrayIndexOutOfBounds exception
Date Wed, 13 Apr 2005 19:20:58 GMT
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


Mime
View raw message