Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General

sort in prefixQuery

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


KrogliakL at gmail

Feb 17, 2012, 11:29 AM

Post #1 of 1 (236 views)
Permalink
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 :

Sort sort = new Sort(new SortField("countfieldname", SortField.INT,true));
PrefixQuery pq = new PrefixQuery(new Term("namefieldname", "prefix"));
indexSearcher.Search(pq,null,10, sort);

But it doesn't work . I get unsorted results.

--
View this message in context: http://lucene.472066.n3.nabble.com/sort-in-prefixQuery-tp3754696p3754696.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Lucene general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.