查找由Lucene索引的术语列表 [英] Find list of terms indexed by Lucene

查看:81
本文介绍了查找由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(特定字段的所有术语): Python:使用Lucene查找单个字段术语( pylucene)

    这篇关于查找由Lucene索引的术语列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆