List Info

Thread: Does someone know how to sort the hits list by a specified document field?




Does someone know how to sort the hits list by a specified document field?
country flaguser name
United States
2007-11-05 00:46:43
Does someone know how to sort the hits list by a specified
document field?
Even if the field is numeric or datetime etc.

-- 
View this message in context: http://www.nabble.com/Does-someone-know-how-to-sort
-the-hits-list-by-a-specified-document-field--tf4749900.html
#a13582008
Sent from the Lucene - Java Users mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: java-user-unsubscribelucene.apache.org
For additional commands, e-mail: java-user-helplucene.apache.org


Re: Does someone know how to sort the hits list by a specified document field?
user name
2007-11-05 02:52:30
Hi.
Just add a Sort object to the search.

Sort sort = new Sort(sortField, !ascending);
Hits[] hits = searcher.search(query, sort);

Kindly

//Marcus

On 11/5/07, jackxin <jackxin2100gmail.com> wrote:
>
>
> Does someone know how to sort the hits list by a
specified document field?
> Even if the field is numeric or datetime etc.
>
> --
> View this message in context:
> http://www.nabble.com/Does-someone-know-how-to-sort
-the-hits-list-by-a-specified-document-field--tf4749900.html
#a13582008
> Sent from the Lucene - Java Users mailing list archive
at Nabble.com.
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: java-user-unsubscribelucene.apache.org
> For additional commands, e-mail: java-user-helplucene.apache.org
>
>


-- 
Marcus Herou Solution Architect & Core Java developer
Tailsweep AB
+46702561312
marcus.heroutailsweep.com
http://www.tailsweep.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )