开发者

Sorting in Lucene treats word differently between upper and lower case?

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]


Index the field "title" as ANALYZED and use an analyzer that lowercases the input text (eg, StandardAnalyzer)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜