-# Copyright (C) 2015, all contributors <meta@public-inbox.org>
+# Copyright (C) 2015 all contributors <meta@public-inbox.org>
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
# based on notmuch, but with no concept of folders, files or flags
package PublicInbox::Search;
$self->{enquire} ||= Search::Xapian::Enquire->new($self->{xdb});
}
+sub mid_prefix {
+ my ($self, $mpfx) = @_;
+ my $query = eval { $self->qp->parse_query("m:$mpfx", FLAG_PARTIAL) };
+ return if $@;
+ my $res = $self->do_enquire($query, { relevance => 1 });
+ return unless $res->{total};
+ [ map { $_->mid } @{$res->{msgs}} ];
+}
+
1;