Hi, please imagine the term "foobar" in a xapian database. I know, that it is possible to match this term with the following queries and flags: 1) "foo" (QueryParser.FLAG_PARTIAL) 2) "foo*" (QueryParser.FLAG_WILDCARD) But I would like to construct a successful query like the following: *bar Is there any way of accomplishing this with xapian? As far as I understand the wildcard flag, it supports only right truncation (at the end of a string). Any help would be great! Thanks for your time, Lars
On Fri, Apr 04, 2008 at 07:27:57AM +0200, Lars Kruse wrote:> please imagine the term "foobar" in a xapian database. > I know, that it is possible to match this term with the following queries and > flags: > 1) "foo" (QueryParser.FLAG_PARTIAL) > 2) "foo*" (QueryParser.FLAG_WILDCARD) > > But I would like to construct a successful query like the following: > *bar > > Is there any way of accomplishing this with xapian? > As far as I understand the wildcard flag, it supports only right truncation (at > the end of a string).If you can suffer increasing the size of your database a fair bit, you can store every term backwards as well (with a suitable prefix), so that *bar becomes <prefix>rab*. The way Xapian works is not generally suited to substring matching at present. J -- /--------------------------------------------------------------------------\ James Aylett xapian.org james at tartarus.org uncertaintydivision.org
Hi,> > But I would like to construct a successful query like the following: > > *bar > > > > Is there any way of accomplishing this with xapian? > > As far as I understand the wildcard flag, it supports only right truncation > > (at the end of a string). > > If you can suffer increasing the size of your database a fair bit, you > can store every term backwards as well (with a suitable prefix), so > that *bar becomes <prefix>rab*.thanks for this hint! It sounds like a reasonable solution for me ... regards, Lars