[Xapian-discuss] using synonyms

Olly Betts olly at survex.com
Tue Oct 21 14:45:07 BST 2008

On Tue, Oct 21, 2008 at 02:31:32PM +0200, Dr.BYTE at web.de wrote:
> $db = new XapianWritableDatabase($db_path, Xapian::DB_CREATE_OR_OPEN);
> $db->add_synonym('pizza', 'fastfood');
> after this, i am indexing searchable data with prefixes:
> $indexer->index_text('pizza', 1, 'XFOOD');

The synonyms are of terms, so you want:

$db->add_synonym('XFOODpizza', 'XFOODfastfood');


More information about the Xapian-discuss mailing list