[Xapian-discuss] Exact matches

Olly Betts olly at survex.com
Wed Jul 2 22:46:39 BST 2008


On Wed, Jul 02, 2008 at 02:21:44PM -0700, Robert Kaye wrote:
> Is there any way I can tweak Xapian to move exact matches to 100% and  
> matches that have more/fewer terms lower?

I would suggest that you take the artist name, normalise it (squash
punctuation and whitespace to a single space or nothing and casefold;
perhaps drop a leading "the" or trailing ", the") and add this as a
prefixed term.

Then do the same to the query string and postprocess the parsed query by
adding this term, probably with OP_OR so that punctuation normalisation
works even if the parsed query doesn't match).

So in this case, the artist term would be "XARTISTduran duran" or
perhaps "XARTISTduranduran".

Cheers,
    Olly



More information about the Xapian-discuss mailing list