在客户端的软件组件中使用了Lucene 2.9,它们使用了很多索引属性,有些是标准化的,有些则不是。我们假设属性xyz
被添加到索引中,如下所示:
index.add(new Field(" xyz",value,Field.Store.YES,Field.Index.UN_TOKENIZED));
当我们在索引中创建新对象时(让我们在3秒内说出150个新对象),我看到了一个临时异常,软件试图在其中一个UNTOKENIZED
属性上执行排序搜索:
Caused by: java.lang.RuntimeException: there are more terms than documents in field "xyz", but it's impossible to sort on tokenized fields
at org.apache.lucene.search.FieldCacheImpl$StringIndexCache.createValue(FieldCacheImpl.java:706) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:208) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.FieldCacheImpl.getStringIndex(FieldCacheImpl.java:676) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.FieldComparator$StringOrdValComparator.setNextReader(FieldComparator.java:667) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:94) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:245) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:236) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:179) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:113) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.Hits.<init>(Hits.java:90) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
at org.apache.lucene.search.Searcher.search(Searcher.java:63) ~[lucene-core-2.9.2.jar:2.9.2 912433 - 2010-02-21 23:51:08]
可以观察到异常几秒钟/分钟,然后消失了。
索引包含大约100万个索引对象。
我知道请问以下内容:
是否存在与未标记属性相关的任何已知问题,例如在向索引添加新对象后运行的任何异步内部Lucene逻辑?至少在查看上面的堆栈跟踪时,似乎有一个fieldcache在某些情况下可能会暂时损坏?在将一个对象添加到索引之后,我认为Lucene没有做任何事情。
感谢您的任何建议(请不要告诉我升级Lucene,我告诉我大约100次给我的客户。)