Markus Wörle
2006-Jul-06 17:44 UTC
[Xapian-discuss] QueryParser and multi-capital prefixes
Hi, 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? Thanks mrks [1] http://thread.gmane.org/gmane.comp.search.xapian.general/1457/ focus=1461
Markus Wörle
2006-Jul-07 15:20 UTC
[Xapian-discuss] QueryParser and multi-capital prefixes
I wrote his email yesterday shortly before xapian.org went down, and I am not sure or my mail arrived this list or not (I haven't got it so far). So I'm trying it again hoping you'll forgive me if there will be a duplicate of this message. Hi, 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? Thanks mrks [1] http://thread.gmane.org/gmane.comp.search.xapian.general/1457/ focus=1461
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