Hi Xiong, You're ranking idea sounds interesting ... are you looking into something akin to the TrafficRank algorithm ? This is moving into the realm of "Personalized search" or "Personalised search", something I'm not aware of appearing on the Lucene mailing lists so far, but something I'm quite interested in exploring.
http://www.earthskater.net/services/marketing/trafficrank-pagerank-webrank.asp SortComparitorSource returns ScoreDocComparator which utilizes the method below: public int compare(ScoreDoc i, ScoreDoc j) { if (lessthancriteria) return -1; if (morethancriteria) return 1; return 0; } Section 6.1 of 'Lucene in Action' will help you more here. >From ScoreDoc you can access ScoreDoc.doc, lucene document id and ScoreDoc.score, the lucene score for document. We regularly open a new IndexReader, and before this reader replaces the production one, we determine f(D) for all documents so that for the user there is almost no performance issue,i.e. f(D) is cached. I suspect you can implement something similar. Cheers, Dan On Fri, 2007-03-16 at 01:50 +0000, xiong wrote: > daniel rosher <daniel.rosher <at> hotonline.com> writes: > > > > > Hi, > > > > This can be achieved by implementing your own implementation of the > > SortComparitorSource interface. > > > > Section 6.1 of Lucene in Action will help you here. > > > > We currently use this method to alter the ranking of documents depending > > on the age of the document by multiplying the current score by a cached > > function f(D) ~ age_of_document_D, so that final score = doc.score*f(D); > > > > Regards, > > Dan > > > Hi Dan, > > By implementing SortComparitorSource, did you recount all the hits scores? > If the returned documents number is big, will it be a performance issue? > > Regards, > Xiong > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > <<This email has been scanned for virus and spam content>> Daniel Rosher Developer d: 0207 3489 912 t: 0870 2020 121 f: 0870 2020 131 m: http://recruiter.hotonline.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This message is sent in confidence for the addressee only. It may contain privileged information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to preserve this confidentiality and to advise us of any errors in transmission. Thank you. This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]