Wildcard Matching #26

ryanb opened this Issue Jun 16, 2009 · 2 comments


None yet
1 participant

ryanb commented Jun 16, 2009

It would be nice if the an asterisk could be used to match any characters in a search. Now Xapian does offer some of this functionality, but it is very limited. You can only do a wildcard match at the end of a term.

It would be nice if this was supported for both normal search string queries and conditions:

Xapit.search("foo*", :conditions => { :name => "bar*" })

One use for this is on an immediate-feedback AJAX search where one gets results as they type the query.


ryanb commented Jun 16, 2009

Hmm, looking into this it is easy to enable in Xapian's QueryParser by adding a Xapian::QueryParser::FLAG_WILDCARD flag. However I also want this to work in the simple query parser and other conditional matching (along with not_conditions).

It appears QueryParser is actually looking at all terms (in alphabetical list), finding the first one that matches the partial term, and then grabbing all terms at that point until it gets to a term which does not match the partial. It then sets up an OP_OR query on all of those terms.

That is not quite as clean as I was hoping, but I guess it will work.


ryanb commented Jun 26, 2009

adding documentation for wildcard matching - closed by 3b33a28

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment