The fields used to determine sort order must be carefully chosen.
选择排序字段一定要细心。
Documents must contain a single term in such a field, and the value of
the term should indicate the document's relative position in a given
sort order.
用于排序的字段在文档当中必须只能含有单一的term,并且这个term的值应该能够准确的准确的定位当前文档在排序中的位置
The field must be indexed, but should not be tokenized, and
does not need to be stored (unless you happen to want it back with the
rest of your document data).
这个字段必须被索引,但是不能被分词,并且不是必须存储的(除非你碰巧希望它返回你文档的剩余字段)
In other words: 也就是说:
document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.NOT_ANALYZED));
If I want to sort some field (for example name is "TITLE") and It must be Analyzed.
Then Do I have to make two field that one is ANALYZED and the other is NOT_ANALYZED like this?
document.add(new Field("TITLE", value, Field.Store.NO. Field.Index.ANALYZED)
document.add(new Field("TITLE_FOR_SORT", value, Field.Store.NO, Field.Index.NOT_ANALYZED)
that is right!
sort构造方法:
Sort()
Sorts by computed relevance.通过计算相关性排序
Sort(SortField... fields)
Sorts in succession by the criteria in each SortField.按照多个字段排序
Sort(SortField field)
Sorts by the criteria in the given SortField.指定单个字段排序
分享到:
相关推荐
lucene排序、设置权重、优化、分布式搜索.pdf
lucene自定义排序实现,大家有兴趣关注我的博客http://blog.csdn.net/wuyinggui10000/article/category/3173543
Lucene根据关键词出现次数排序以及自定义排序,可以自定义优先级,包含list字段排序与pom等
lucene的排序过滤和分页,lucene开发技术,lucene下载
在一定深度介绍LUCENE的排序算法和打分公式。
18.Lucene排序 共6页 19.Lucene过滤 共4页 20.Lucene分词器1 共3页 21.Lucene分词器2 共9页 22.Lucene分词器3 共4页 23.Lucene项目实战1 共6页 24.Lucene项目实战2 共6页 25.Lucene项目实战3 共6页 26.Lucene项目...
传统上,人们将信息检索系统返回结果的排序称为"相关排序" (relevance ranking) ,隐含其中各条目的顺序反映结果和查询的相关程度。
lucene4.3 按坐标距离排序,里面写了个简单的例子。运行就行
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part3 SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part2 SSH + Lucene + 分页 + 排序 + 高亮 ...
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part3 SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part2 SSH + Lucene + 分页 + 排序 + 高亮 ...
NULL 博文链接:https://iamyida.iteye.com/blog/2201372
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎
随着Web技术的迅速发展,提供个性化服务的搜索引擎技术受到用户的广泛关注,网页排序是其中的关键技术之一...实验结果证明,改进后的排序算法能够较好地提高信息检索的准确度,为用户带来了优于Lucene自身排序的搜索体验。
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part3 SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part2 SSH + Lucene + 分页 + 排序 + 高亮 ...
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part3 SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part2 SSH + Lucene + 分页 + 排序 + 高亮 ...
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part3 SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part2 SSH + Lucene + 分页 + 排序 + 高亮 ...
SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part3 SSH + Lucene + 分页 + 排序 + 高亮 模拟简单新闻网站搜索引擎--NewsWithSearch.part2 SSH + Lucene + 分页 + 排序 + 高亮 ...
Lucene中的自定义排序功能和Java集合中的自定义排序的实现方法差不多,都要实现一下比较接口. 在Java中只要实现Comparable接口就可以了.但是在Lucene中要实现SortComparatorSource接口和ScoreDocComparator接口.在...
并按照lucene的得分算法进行多条件检索并按照得分算法计算匹配度排序。 可以输入一句话进行检索。 lucene.net的版本为2.9.2 盘古分词的版本为2.3.1 并实现了高亮功能。高亮上使用的是盘古分词的高亮算法。 有点小bug...
赠送jar包:lucene-spatial3d-6.6.0.jar; 赠送原API文档:lucene-spatial3d-6.6.0-javadoc.jar; 赠送源代码:lucene-spatial3d-6.6.0-sources.jar; 赠送Maven依赖信息文件:lucene-spatial3d-6.6.0.pom; 包含...