[Xapian-discuss] Search through specific fields value

Andreas Marienborg andreas at startsiden.no
Wed Aug 6 09:11:10 BST 2008


On Jul 29, 2008, at 6:06 PM, Sven Kummer wrote:

> hi all,
>
> is there a option for search through specific fields? i want have a  
> document
> and want add a field "firstname" with value "foo" and a field  
> "lastname"
> with value "bar". how can i filter by "lastname" with value "bar"?

Hello Sven

The normal approach is to use a prefix, like XLASTbar XFIRSTfoo, then  
if you use the query parser, add that as a prefix:

$qp->add_prefix('first', 'XFIRST') or somesuch.

then you can search first:foo for instance.

- andreas






More information about the Xapian-discuss mailing list