I've been asked this question and I think I know the answer, but I thought I'd check. A client wants to be able to do wildcard searches, e. g. where w??k would match week or weak and tra* where it would match anything starting with tra, like trash or travel, etc. Any such feature in Xapian? I don't recall seeing it if there is. Thanks, Jim.
On Thu, Feb 09, 2006 at 08:34:00AM -0500, Jim Lynch wrote:> A client wants to be able to do wildcard searches, e. g. where w??k > would match week or weak and tra* where it would match anything starting > with tra, like trash or travel, etc. > > Any such feature in Xapian?Right-truncation (tra*) is supported as of 0.9.2, but due to a typo in the documentation comments isn't in the API docs. I'll fix that. Pass FLAG_WILDCARD as the second argument to QueryParser::parse_query() to enable support: xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#a11 It may be slow for a large database and a short stem (e.g. "e*"). A single character wildcard (w??k) isn't currently supported. Cheers, Olly