查找 Lucene 索引的术语列表 [英] Find list of terms indexed by Lucene
本文介绍了查找 Lucene 索引的术语列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以将 Lucene 索引中的所有术语列表提取为字符串列表?我在文档中找不到该功能.谢谢!
Is it possible to extract the list of all the terms in a Lucene index as a list of strings? I couldn't find that functionality in the doc. Thanks!
推荐答案
Lucene 3:
Java:
IndexReader indexReader = IndexReader.open(path);
TermEnum termEnum = indexReader.terms();
while (termEnum.next()) {
Term term = termEnum.term();
System.out.println(term.text());
}
termEnum.close();
indexReader.close();
Java(特定领域的所有术语):如何从 Lucene 的特定字段中获取唯一术语列表?
Python:使用 Lucene (PyLucene)
这篇关于查找 Lucene 索引的术语列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文