[Xapian-discuss] QueryParser and multi-capital prefixes

Olly Betts olly at survex.com
Mon Jul 10 16:37:30 BST 2006


Hmm, I wrote a reply to this but it appears it didn't survive the crash...

On Thu, Jul 06, 2006 at 06:43:58PM +0200, Markus W?rle wrote:
> I'm using user-defined X-starting multi-capital prefixes for boolean  
> terms, and I'm wondering about how a corresponding query-string has to  
> be formated to work with the QueryParser.
> 
> For example: If i try
> 	$qp->parse_query('XFOObar'),
> 
> the resulting query is
> 	'Xapian::Query(xfoobar:(pos=1))' - the term has been lower-cased.
> 
> It works fine, if i use a
> 	$qp->add_boolean_prefix("foo", "XFOO");
> 
> and a query like
> 	$qp->parse_query('foo:bar'),
> 
> But thats not what I want, because I don't want have to know all  
> possible prefixes at this point. Is there any solution for me except  
> breaking the recommendations on how to name terms [1], or building my  
> own parser?

Do you really expect your end-users to want to type "XFOObar"?

The QueryParser deliberately separates the internal representation
"XFOObar" from the external "foo:bar", and I don't think it makes
sense to work against that.

It sounds like a flag to say "if you don't know about prefix 'foo', then
treat 'foo:bar' as 'XFOObar'" would be a good way to handle your
problem.

Cheers,
    Olly



More information about the Xapian-discuss mailing list