lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lampa24 <Krogli...@gmail.com>
Subject Sort in PrefixQuery
Date Sat, 18 Feb 2012 16:19:21 GMT
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-tp3756573p3756573.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message