1 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 package PublicInbox::LeiSearch;
7 use parent qw(PublicInbox::ExtSearch);
8 use PublicInbox::Search qw(xap_terms);
10 # get combined docid from over.num:
11 # (not generic Xapian, only works with our sharding scheme)
13 my ($self, $num) = @_;
14 my $nshard = $self->{nshard};
15 ($num - 1) * $nshard + $num % $nshard + 1;
19 my ($self, $num) = @_; # num_or_mitem
20 my $xdb = $self->xdb; # set {nshard};
21 my $docid = ref($num) ? $num->get_docid : num2docid($self, $num);
22 my $kw = xap_terms('K', $xdb, $docid);
23 warn "E: #$docid ($num): $@\n" if $@;
24 wantarray ? sort(keys(%$kw)) : $kw;