[Xapian-discuss] QueryParser and prefixes

Fabrice Colin fabrice.colin at gmail.com
Wed Nov 1 12:42:39 GMT 2006


On 11/1/06, Olly Betts <olly at survex.com> wrote:
> On Mon, Oct 30, 2006 at 10:32:12PM +0800, Fabrice Colin wrote:
> > Should the colon character only be used if the term being prefixed starts
> > with a capital ?
>
> Yes, since the QueryParser can't easily know if a particular prefix should
> have a colon in general, only in specific cases.
>
> If you always want a colon, just specify it explicitly in the second
> argument to QueryParser::add_boolean_prefix.
>
Cool. I'll do that then.

> > How I should prefix terms that don't start with a non-alphanumeric
> > character ?
>
> Looking at the code, a prefixed boolean term is taken as ending at the
> first space or control character or ')', but the first character must be
> alphanumeric because of how the test for a prefixed string or
> sub-expression is handled.
>
> Try the attached patch which allows any non-space, non-control first
> character other than ')'.
>
Thanks for the patch ! I'll give it a spin and report here.

Cheers.

Fabrice



More information about the Xapian-discuss mailing list