首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

删除索引报错!解决方法

2012-02-04 
删除索引报错!blic Integer query(IndexSearcher searcher) throws Exception {Hits hits queryByKeys(t

删除索引报错!
blic Integer query(IndexSearcher searcher) throws Exception {  
  
  Hits hits = queryByKeys(termsArrays, searcher);  
  IndexReader reader = searcher.getIndexReader();  
  
  for (int i = 0; i < hits.length(); i++) {  
  int num = hits.id(i);  
  reader.deleteDocument(num); // 这里报错
  log.debug("delete indexdoc ID: " + num);  
  }  
  
  return new Integer(hits.length());  
  }  

报错如下:

java.lang.ArrayIndexOutOfBoundsException: 10000 >= 10000
at java.util.Vector.elementAt(Vector.java:431) 
at org.apache.lucene.search.Hits.hitDoc(Hits.java:157) 
at org.apache.lucene.search.Hits.id(Hits.java:131) 
at com.openlibs.noteer.search.SearchUtils$3.query(SearchUtils.java:206) 



每次更新索引,数据量在万以上的时候,就报错。我更新的原则是先删除,再insert。这个问题怎么解决?


[解决办法]
请参考 javaeye上的文章
[解决办法]
请参考
删除索引报错
[解决办法]
删除索引报错

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 26717
 

热点排行