摘要:
lucene问题汇总:Lucene常见问题汇总从api中我们可以了解到:The fields usedto determine sort order must be carefully chosen. Documents must contain asingle term in such a field, and the value of the term should indicate thedocument's relative position in a given sort order. The field must be indexed,but should not be t 阅读全文
摘要:
lucene问题汇总:Lucene常见问题汇总当IndexSearcher打开一份磁盘索引后,IndexSearcher实例持有的是打开索引时的一份镜像索引,而执行优化动作后,将会把优化后的索引存储到原磁盘路径下,导致索引容量翻倍。那么怎么解决这个问题呢?IndexSearcher实例执行re-open动作,然后再执行优化操作,此时的优化操作很快,相当于是删除之前IndexSearcher持有的镜像索引。特别是在实时索引过程中,对大索引的优化一般比较耗时,因此合理的解决方案是:单独开一条线程执行优化操作,当优化完成后对IndexSearcher实例进行re-open操作,然后再执行一次优化操作 阅读全文
摘要:
lucene问题汇总:Lucene常见问题汇总从lucene API 可知,IndexReader和IndexWriter都具有删除指定文档的功能。IndexReader:voiddeleteDocument(intdocNum)Deletes the document numbered docNum.intdeleteDocuments(Termterm)Deletes all documents that have a given term indexed.IndexWriter:voiddeleteDocuments(Query...queries)Deletes the documen 阅读全文