Java Mailing List Archive

http://www.java2.5341.com/

Home » java-user.lucene »

Order the index by timestamp field and Get n documents

ajaxtrend

2008-11-10

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,
 In my index, there is a field called timestamp which is long value of date. I am trying to get sort all documents by timestamp and get N documents.
I am trying to find a way to create a query like "timestamp > 0" and then order the result by timestamp and get N fields. However I am not able to do that. Suggest me the best way. Or there are any lowlevel method available for the same.

I am using Lucene 2.3.1 and looking into method search(Weight weight, Filter filter, int nDocs, Sort sort) in IndexSearcher. Trying to know how to create a Weight object.

Anyway, I would really appreciate your suggestion....

-RB


   

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@(protected)
For additional commands, e-mail: java-user-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.