Lucene 中的排序对单词大小写的处理方式不同吗?
我在排序[1]上有以下代码,但最终得到一个结果集,其中首先放置数字开头的单词,然后将大写单词升序排序,将小写单词升序排序在底部,如下面的[2]。
这是设计使然吗?如果是这样,我如何在不考虑案件的情况下对它们进行排序?
[1] Searcher.Search(Query, null, 30, new Sort(new SortField("title", SortField.STRING)));
[2] [42bskfdj3434] [快五] [绿灯侠] 【功夫熊猫】 [鲍勃] [笔记本电脑] [xoom] [向往]
I have the following code on sorting[1], but I ended up with a result set in which words begin with numeric placed first and then words in uppercase sorted ascendingly with words in lowercase sorted ascendingly at the bottom, like below [2].
Is this by design? If so how can I sort them without the case being taken into consideration?
[1]Searcher.Search(Query, null, 30, new Sort(new SortField("title", SortField.STRING)));
[2]
[42bskfdj3434]
[Fast Five]
[Green Lantern]
[Kung Fu Panda]
[bob]
[laptop]
[xoom]
[yearn]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将字段“标题”索引为 ANALYZED 并使用小写输入文本的分析器(例如 StandardAnalyzer)
Index the field "title" as ANALYZED and use an analyzer that lowercases the input text (eg, StandardAnalyzer)