1.不带排序的方法
TopDocCollector collector = new TopDocCollector(100);
chinaMSearcher.search(query1,null,collector);
ScoreDoc[] cHits = collector.topDocs().scoreDocs;
Hits cHits = chinaMSearcher.search(query1, sort);
2.带排序的
Sort sort = new Sort(new SortField[]{new SortField("maxCpc",true),new SortField("RankIndex",true)});
ScoreDoc[] cHits = chinaMSearcher.search(query1,null,100,sort).scoreDocs;
3.
if (cHits.length > 0) {
Document doc = chinaMSearcher.doc(cHits[i++].doc);
float score = cHits[i].score;
}
分享到:
相关推荐
Lucene2.4入门总结lucene2.4 人门 field 多条件搜索
java拼车网雏形(Ext2.0+SSH+oracle10g+lucene2.4)
lucene 2.4 jar lucene2.4版本的JAR包
能够直接运行的Lucene2.4样例以及全面注释; + Lucene中文文档,能够帮助你最快掌握Lucene2.4
ictclas4j for lucene 2.4 任何人不得将此用于商业用途,仅限个人学习研究之用.该开源项目遵循Apache License 2.0
庖丁解牛 源码 for Lucene 2.4
Luene2.4版本在以前的基础上进行了不少的改动,性能上也提升了不少,这里边学习边写了一个简单的例子,给初学者行个方便!
struts2 + spring2.5 + hibernate 3.2 + lucene 2.4 + compass 2.0 包含所有jar包,按readme.txt导入并运行即可 开始不用分了................
lucene2.4手册,是开发搜索引擎的好帮手.
NULL 博文链接:https://chenhua-1984.iteye.com/blog/380779
支持net4.0环境下运行,Lucene.net版本为3.0,PanGu版本为2.4
Lucene2.4.1的源代码,包括core包和demos包的内容。
lucene-core-2.4.0.jar,lucene-analyzer-2.4.0.jar,lucene-highlighter-2.4.0.jar,je-analysis-1.5.3.jar
基于lucene 2.4简单的一个索引和搜索实例
might not be compatible with the Snowball module in Lucene 2.4 or greater. For more information about this issue see: https://issues.apache.org/jira/browse/LUCENE-1142 For more information on ...
lucene.net用于在.net平台中开发搜索引擎。使得.net开发全文搜索变得很方便。
lucene-2.3.1.jar.7z
Lucene 庖丁解牛分词法 , 能够使用它解决中文分词问题。
2.4 查询索引的基本信息 5 2.5 删除和更新索引 5 (1) 使用writer删除 5 (2) 使用reader删除 5 (3) 恢复删除 5 (4) 彻底删除 6 (5) 更新索引 6 (6) 手动优化 6 2.6 索引文件作用 7 第三章 搜索功能 8 3.1 简单搜索 8 ...