Justin Finkelstein
2011-Jun-01 10:06 UTC
[Xapian-discuss] Relevance, weighting and searching by specifically weighted text
Hi guys In our implementation of Xapian for one of our sites, we index the title, subtitle, summary and table of contents of around 200,000 products on ReportBuyer.com. When we create each Xapian doc to index this information, we apply a weighting to each of these 'fields' and add these to the doc using index_text with the second parameter passing in a weighting. I've been asked if it's possible to narrow queries to just a particular field (translating into fields with a specific weight) within the index. I've had a look at the reference for the Xapian_Enquire::set_weighting_scheme method and cannot see a way where altering the parameters of the BM25 weighting scheme can achieve this. Is there a way this can be done? Thanks, Justin -- Redwire Design Limited 54 Maltings Place 169 Tower Bridge Road London SE1 3LJ www.redwiredesign.com [ 020 7403 1444 ] - voice [ 020 7378 8711 ] - fax
Richard Boulton
2011-Jun-01 11:14 UTC
[Xapian-discuss] Relevance, weighting and searching by specifically weighted text
On 1 June 2011 11:06, Justin Finkelstein> I've been asked if it's possible to narrow queries to just a particular > field (translating into fields with a specific weight) within the index. > I've had a look at the reference for the > Xapian_Enquire::set_weighting_scheme method and cannot see a way where > altering the parameters of the BM25 weighting scheme can achieve this. > > Is there a way this can be done?Yes, there is. You need to index each field you want to be able to search (or weight) individually, with a unique prefix. Then, see http://trac.xapian.org/wiki/FAQ/ExtraWeight -- Richard