[Xapian-discuss] searching through different "fields"?

James Aylett james-xapian at tartarus.org
Thu Aug 14 14:32:23 BST 2008


On Thu, Aug 14, 2008 at 03:25:38PM +0200, Dr.BYTE at web.de wrote:

> i want build up a user search with xapian and php5. but i don't know
> how searching thru different fields. result should show all records
> got "cars or party or friends" in the field "interessts" AND "pizza
> or spaghetti" in field "food".

You want to map each 'field' to a term prefix, and then give those
prefixes meaningful names for your users. So you'll end up with
something like "interests:(cars OR party OR friends) AND food:(pizza
OR spaghetti)" for the above.

If you're using omega, look at the documentation of the $setmap{}
OmegaScript command (talking about the 'prefix' map), and the
scriptindex documentation, which is the easiest way of generating
prefixes for omega.

If you aren't, look at the QueryParser documentation for an
explanation of how prefix mapping works.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list