Results 1 to 1 of 1
Thread: sort in prefixQuery
- 02-16-2012, 04:44 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 1
- Rep Power
- 0
sort in prefixQuery
Hello,
I use lucene. I indexed documents with two fields. First field is name and second field is count. I use this index for autocomplete. I need find 10 names by prefix and the higest count.
I use code like this :
But it doesn't work . I get unsorted results.Java Code:Sort sort = new Sort(new SortField("countfieldname", SortField.INT,true)); PrefixQuery pq = new PrefixQuery(new Term("namefieldname", "prefix")); indexSearcher.Search(pq,null,10, sort);
Similar Threads
-
sort according
By aizen92 in forum New To JavaReplies: 26Last Post: 01-17-2011, 12:36 PM -
Using Merge Sort to sort an ArrayList of Strings
By coldfire in forum New To JavaReplies: 3Last Post: 03-13-2009, 01:03 AM -
How to sort a list using Bubble sort algorithm
By Java Tip in forum AlgorithmsReplies: 3Last Post: 04-29-2008, 08:04 PM -
sort
By Camden in forum New To JavaReplies: 7Last Post: 11-28-2007, 01:11 AM -
how to sort
By Feng in forum New To JavaReplies: 1Last Post: 11-20-2007, 06:56 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks