info@bannershift.com
2006-Jan-29 22:59 UTC
[Xapian-discuss] Prioritizing xapian search results
Hello It is possible somehow to give higher priority to recent document. For example, when adding new document to the database, I will add a term that specifies date of the document. During the search, the date of the document is taken into account in the algorithm that calculates document relevancy. In another project I am working on, I would like to limit number of pages returned from the same site. Basically I need to limit number of results that could have the same term that specifies site id. I would like to know if this could be done. I will really appreciate your help Yuli http://www.bannershift.com/ http://www.ircjunky.com/
On Sun, Jan 29, 2006 at 05:45:36PM -0500, info@bannershift.com wrote:> It is possible somehow to give higher priority to recent document. For > example, when adding new document to the database, I will add a term > that specifies date of the document. During the search, the date of the > document is taken into account in the algorithm that calculates > document relevancy.This is what the match bias functor was originally intended to be for. You might find it useful in its current state: http://www.xapian.org/docs/apidoc/html/classXapian_1_1Enquire.html#a13> In another project I am working on, I would like to limit number of > pages returned from the same site. Basically I need to limit number of > results that could have the same term that specifies site id. I would > like to know if this could be done.You can can eliminate all but one page from the same site by adding the sitename as a value and using Enquire::set_collapse_key: http://www.xapian.org/docs/apidoc/html/classXapian_1_1Enquire.html#a5 I think it should be possible to enhance the collapse key to keep up to N matches (where N can be specified). I'll investigate when I get a chance. Cheers, Olly