[Xapian-discuss] Giving titles extra weights and searching with
titles
James Aylett
james-xapian at tartarus.org
Thu Mar 30 11:49:40 BST 2006
On Wed, Mar 29, 2006 at 11:12:57PM +0100, Paul Dixon wrote:
> What's the best technique for giving the terms in, say, a document
> title more weight than the terms? Do I simply use the third "wdfinc
> "parameter to Xapian::Document::add_posting to give it more weight?
That will do it, yes.
> Secondly, if I wanted to make it possible to search just within a
> title, would I also need to store the same of terms prefixed with, say
> TITLE: to do that?
I'd be inclined to generate terms prefixed with "S", and then use a
prefix map to the QueryParser to map "title:" in a query to "S".
qp.add_prefix("title", "S")
if you're using it directly, or something like:
$setmap{prefix,title,S}
in an omegascript template.
J
--
/--------------------------------------------------------------------------\
James Aylett xapian.org
james at tartarus.org uncertaintydivision.org
More information about the Xapian-discuss
mailing list