]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdx.pm
searchidx: v1: raise on msgmap init failure
[public-inbox.git] / lib / PublicInbox / SearchIdx.pm
index 928152ec4df4ee83e773db9af38ab0c293ab58f2..b886ce789b7943dfb5eb2c248bb62c6329e36acc 100644 (file)
@@ -451,7 +451,7 @@ sub add_xapian ($$$$) {
 sub _msgmap_init ($) {
        my ($self) = @_;
        die "BUG: _msgmap_init is only for v1\n" if $self->{ibx}->version != 1;
-       $self->{mm} //= eval {
+       $self->{mm} //= do {
                require PublicInbox::Msgmap;
                PublicInbox::Msgmap->new_file($self->{ibx}, 1);
        };
@@ -517,6 +517,12 @@ sub add_eidx_info {
        $self->{xdb}->replace_document($docid, $doc);
 }
 
+sub get_terms {
+       my ($self, $pfx, $docid) = @_;
+       begin_txn_lazy($self);
+       xap_terms($pfx, $self->{xdb}, $docid);
+}
+
 sub remove_eidx_info {
        my ($self, $docid, $eidx_key, $eml) = @_;
        begin_txn_lazy($self);