`
shangjava
  • 浏览: 1188547 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Lucene 使用前缀检索Document中Field 以及关于 Hit

阅读更多

hits这个类相当于一个List<Document>,至少我是这么认为的。 可能当中的Doc已经被处理过了。

在高级的lucene jar版本中,可能被删除了这个类了。

Hits中的函数:

Method Summary
Document doc(intn)
Returns the stored fields of the nth document in this set.
int id(intn)
Returns the id for the nth document in this set.
int length()
Returns the total number of hits available in this set.
float score(intn)
Returns the score for the nth document in this set.

代码:

输出::

查找 "前缀为'l'的文档" :
找到lihan

查找 "前缀为'zh'的文档" :
找到gongshang

查找 "前缀为'a'的文档" :
找到amen

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics