Actually there is still a better way.... The Priority Queue takes a Search Comparable, by default it takes the Score. You can change this to DocId or any other field. Thus create a new Sort comparable function and simply pass it....
Now, when you get the hits object, you'll get the 40 latest hits (or you can increase the size of the number of hits to return). CC- -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Chen Sent: Sunday, October 31, 2004 11:51 PM To: [EMAIL PROTECTED] Subject: [Nutch-dev] Re: Any way to sort hits by date? Let me answer my own question: Create a new queryFilter for date. Then create a search function that searches by today, yesterday, the day before, etc., and return those hits. I believe that should work... Andrew On Sun, 31 Oct 2004 20:33:03 -0800, Andrew Chen <[EMAIL PROTECTED]> wrote: > Is there an easy way to sort search results by date? > > I'm working on a project that requires date first, then relevance. > Looking at the Hits and Hit classes, it doesn't look like there's an > easy way to sort results except by score. > > I can always do a sort at the very top layer in a bean, but maybe > there's a faster way? > > Any thoughts? > > Andrew > ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Nutch-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nutch-developers ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Nutch-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nutch-developers
