[Xapian-discuss] How to really make use of omega/xapian? (for omega with PHP Mysql)

Olly Betts olly at survex.com
Mon Oct 16 01:04:38 BST 2006


On Thu, Oct 05, 2006 at 09:17:20AM +0100, Olly Betts wrote:
> If you want separate form fields for "author" and "body" queries, you
> can't quite achieve this using Omega unmodified at present.  That really
> should be possible - file a wishlist bug and I'll take a look when I'm
> not in the middle of a release.  Or if you want to work on a patch, I
> can point you in the right direction.

Sorry for not getting back to looking at this sooner.

I think what's needed is:

Some way to indicate which prefix a free text input uses.  Currently
"P" is the single free text input (actually you can have multiple
instances, but they're all just concatenated).  So if as well as
(or instead of) "P", you could have one or more instances of
"P.<prefix>" - e.g. "P.A" for the author.  This would need to happen in
omega's query.cc, perhaps with changes in omega.cc too.

Then the Xapian::QueryParser class needs a way to specify the default
prefix (currently this default is always "no prefix") - I think you'd
just need to change the "" which gets pushed onto prefix_stack at
the start of parse_query() in xapian-core's queryparser.lemony.

And then you just parse each P.<prefix> separately and OP_AND the
resultant Xapian::Query objects together.

Cheers,
    Olly



More information about the Xapian-discuss mailing list