Hello everyone, I'm using Xapian at work (PHP bindings) and I have to make it accept '##' as a term to index. We have a layer on top of xapian, but as far as I can tell, Xapian's QueryParser is removing them from the query. So, if I search for just '##' I get an empty query, after Xapian parsed it. I've seen the flags this class accepts, but I can't do what I want with those ( http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html ) Any help will be highly appreciated! Regards!
On Sun, May 03, 2015 at 07:34:32PM +0000, Lautaro M wrote:> I'm using Xapian at work (PHP bindings) and I have to make it accept > '##' as a term to index. We have a layer on top of xapian, but as far > as I can tell, Xapian's QueryParser is removing them from the query. > So, if I search for just '##' I get an empty query, after Xapian > parsed it. I've seen the flags this class accepts, but I can't do what > I want with those ( > http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html )QueryParser doesn't currently allow controlling the characters which make up a word, but you can just construct a Query object directly for any term you want: $hashquery = new XapianQuery('##'); Cheers, Olly
Ok, but suppose I have a complex query, something like "(a OR b) AND NOT c OR ##". Do I have to parse the query by myself?> Date: Mon, 4 May 2015 03:03:24 +0100 > From: olly at survex.com > To: lautaromedrano at hotmail.com > CC: xapian-discuss at lists.xapian.org > Subject: Re: [Xapian-discuss] Make Xapian accept all characters > > On Sun, May 03, 2015 at 07:34:32PM +0000, Lautaro M wrote: > > I'm using Xapian at work (PHP bindings) and I have to make it accept > > '##' as a term to index. We have a layer on top of xapian, but as far > > as I can tell, Xapian's QueryParser is removing them from the query. > > So, if I search for just '##' I get an empty query, after Xapian > > parsed it. I've seen the flags this class accepts, but I can't do what > > I want with those ( > > http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html ) > > QueryParser doesn't currently allow controlling the characters which > make up a word, but you can just construct a Query object directly > for any term you want: > > $hashquery = new XapianQuery('##'); > > Cheers, > Olly