choosing between probabilistic and boolean prefixes for terms

Eric Wong e at
Thu Jul 19 21:32:23 BST 2018

Hi all,

public-inbox allows searching for git blob names (e.g. "badc0ffee")
in patches.  Initially, I chose to use add_prefix for probabilistic
terms, since I assumed it could be a superset of what boolean
searching offered.  Unfortunately, it doesn't seem to be the case
because stemming is interfering.

So switching to boolean filtering seems to work; and it is
fine for mechanical searches I plan on doing:

Now I wonder, is there a way to get the best-of-both-worlds so
a human can still use wildcards?

public-inbox also allows searches on pathnames, and maybe that
should use boolean filtering, too...

My setup for the query parser isn't anything special:

our $LANG = 'english';
sub stemmer { Search::Xapian::Stem->new($LANG) }

sub qp {
	my ($self) = @_;

	my $qp = $self->{query_parser};
	return $qp if $qp;

	# new parser
	$qp = Search::Xapian::QueryParser->new;
		Search::Xapian::NumberValueRangeProcessor->new(YYYYMMDD, 'd:'));
		Search::Xapian::NumberValueRangeProcessor->new(DT, 'dt:'));

In any case, all the code is available via:

	git clone

More information about the Xapian-discuss mailing list