Hello, >> ok, good idea, but how can i do that? >>
that really depends on where you get your documents from. Sorry, as this is quite an unspecific problem, I can not give specific code. If, for instance, the documents come from a database, you could use the SQL-Query to compute an ordered list of document id's sorted by date - then you can create a new index and insert each document one by one by the order given by the list. In general, if no such external sorting mechanism exists, I would make a Java sorter class that holds some link to the document (such as its filename or URL or whatever) and its date (from wherever you have that info). Make sure that the class implements Comparable and write the compareTo-method such that it compares the dates appropriately. Then for each document you have, create a sorter object and put it into a TreeSet. After you have added all sorter objects, you have a sorted collection of the documents and can insert them in order into a Lucene index. Clear? Karsten -----Urspr�ngliche Nachricht----- Von: none none [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 10. Oktober 2003 16:21 An: Lucene Developers List Betreff: Re: Better way to Sort by Date ok, good idea, but how can i do that? any examples? thank you, -- --------- Original Message --------- DATE: Fri, 10 Oct 2003 09:18:33 From: "Karsten Konrad" <[EMAIL PROTECTED]> To: "Lucene Developers List" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]> Cc: > >Hi, > >the fastest way would be to build your index such that the documents >are inserted in the order of their date. You can then sort a search >result very quickly by date by sorting the document numbers in the >result. > >Regards, > >Mit freundlichen Gr��en aus Saarbr�cken > >-- > >Dr.-Ing. Karsten Konrad >Head of Artificial Intelligence Lab > >XtraMind Technologies GmbH >Stuhlsatzenhausweg 3 >D-66123 Saarbr�cken >Phone: +49 (681) 3025113 >Fax: +49 (681) 3025109 >[EMAIL PROTECTED] >www.xtramind.com > >Besuchen Sie uns auf der SYSTEMS! >20.-24. Oktober 2003, Neue Messe M�nchen >Halle A1, Stand 518 > > > > >-----Urspr�ngliche Nachricht----- >Von: none none [mailto:[EMAIL PROTECTED] >Gesendet: Freitag, 10. Oktober 2003 06:50 >An: [EMAIL PROTECTED] >Betreff: Better way to Sort by Date > > >hi all, >what is the fastest way to sort results by date? >anybody implemented it yet? any good performance? > >thank you, >Korfut. > > > >____________________________________________________________ >Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! >http://login.mail.lycos.com/r/referral?aid=27005 > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > ____________________________________________________________ Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
