lucene多线程去重
用MultiSearcher或ParallelMultiSearcher....
DuplicateFilter filter = new DuplicateFilter("TYPE");//去重复
MultiSearcher multiSearcher=....
multiSearcher.search(..,filter,...);
报错:
java.lang.ArrayIndexOutOfBoundsException: 2147483647
at org.apache.lucene.search.TermScorer.score(TermScorer.java:130)
at org.apache.lucene.search.ConjunctionScorer.score(ConjunctionScorer.java:133)
at org.apache.lucene.search.BooleanScorer2$2.score(BooleanScorer2.java:182)
at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java:303)
at
org.apache.lucene.search.BooleanScorer$BooleanScorerCollector.collect(BooleanScorer.java:87)
at org.apache.lucene.search.Scorer.score(Scorer.java:84)
at org.apache.lucene.search.BooleanScorer.score(BooleanScorer.java:269)
at org.apache.lucene.search.BooleanScorer.score(BooleanScorer.java:330)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:207)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:194)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:175)
at org.apache.lucene.search.MultiSearcher$MultiSearcherCallableWithSort.call(MultiSearcher.java:410)
at org.apache.lucene.search.MultiSearcher.search(MultiSearcher.java:230)
at org.apache.lucene.search.Searcher.search(Searcher.java:49)
... Lucene Filter --------------------编程问答-------------------- 哪地方数组越界了。断点跟一下 --------------------编程问答-------------------- 多线程去重的话,估计是在最后一条有多个线程去去重,导致了数组下标越界了,在要去重的数组上加上同步应该就没问题了 --------------------编程问答-------------------- ArrayIndexOutOfBoundsException: 2147483647
数组越界,这个有点小大啊。。。
补充:Java , Web 开发