[Xapian-discuss] Query Parser and Indexes

Olly Betts olly at survex.com
Fri Dec 30 03:22:05 GMT 2005


On Fri, Dec 30, 2005 at 12:31:51AM +0000, Ted Jordan wrote:
> "If the database has been indexed with prefixes on probabilistic terms from 
> certain fields, you can set up a prefix map so that the user can search within 
> those fields. For example author:dickens title:shop might find documents by 
> dickens with shop in the title. You can also specify a prefix on a quoted 
> phrase or on a bracketed expression"
> 
> I've added a term using the (PHP wrapper) syntax:
> 
> Document_add_term($doc, 'extid:1234');  // for example

Did you add an entry to the prefix map for extid?

Even if the prefix you want to make visible to the end user is actually
the same as that on the terms, you still need to tell the QueryParser to
map it (since you may not want the end user to be able to use certain
term prefixes which are in the database for other purposes; also you may
want search modes which don't support some or all prefixes).

So you need to call something like this before you actually parse the
query:

QueryParser_add_prefix($qp, "extid", "extid");

Cheers,
    Olly



More information about the Xapian-discuss mailing list