johnl / xapian-fu

A nicer Ruby interface for the Xapian full text indexer
https://www.rubydoc.info/github/johnl/xapian-fu
Other
51 stars 15 forks source link

Add support for Xapian::QueryParser::set_max_wildcard_expansion() #19

Open glaville opened 11 years ago

glaville commented 11 years ago

When a Xapian database contains many variants of the same, short words (such as test1, test2, test3, test4, test5, test6...), researching wildcard patterns such as "test" becomes very expansive, both in time and memory, than longer one such as "test4" or "test40*", for example.

The raw Xapian binding provides a QueryParser::set_max_wildcard_expansion function [1] which allow the user to limit the number of expansions retained in this use case (by default 0, or unlimited): However, there does not appear to any easy way to achieve using the Xapian-fu.

Would it be possible to add support for a :max_wildcard_expansion option in search requests?

[1] http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#7651d48cdc661c0605c475925170cc71