my ($self, $qstr, $opt) = @_;
$opt //= {};
$opt->{relevance} //= -2;
- $self->mset($qstr //= 'bytes:1..', $opt);
+ $self->mset($qstr //= 'z:1..', $opt);
}
sub over {}
my $mset;
my $each_smsg = $lei->{ovv}->ovv_each_smsg_cb($lei, $ibxish);
my $can_kw = !!$ibxish->can('msg_keywords');
- my $fl = $lei->{opt}->{threads} > 1;
+ my $fl = $lei->{opt}->{threads} > 1 ? [ 'flagged' ] : undef;
do {
$mset = $srch->mset($mo->{qstr}, $mo);
mset_progress($lei, $desc, $mset->size,
if ($mitem) {
if ($can_kw) {
mitem_kw($smsg, $mitem, $fl);
- } else {
- $smsg->{kw} = [ 'flagged' ];
+ } elsif ($fl) {
+ $smsg->{kw} = $fl;
}
}
$each_smsg->($smsg, $mitem);
sub each_remote_eml { # callback for MboxReader->mboxrd
my ($eml, $self, $lei, $each_smsg) = @_;
- $lei->{sto}->ipc_do('add_eml', $eml) if $lei->{sto}; # --import-remote
+ $lei->{sto}->ipc_do('add_eml', $eml) if $lei->{opt}->{'import-remote'};
my $smsg = bless {}, 'PublicInbox::Smsg';
$smsg->populate($eml);
$smsg->parse_references($eml, mids($eml));
$self->SUPER::ipc_atfork_child;
}
+sub delete_pkt_op { # OnDestroy callback
+ my $unclosed_after_die = delete($_[0])->{pkt_op_p} or return;
+ close $unclosed_after_die;
+}
+
sub do_query {
my ($self, $lei) = @_;
my $l2m = $lei->{l2m};
'incr_start_query' => [ \&incr_start_query, $self, $l2m ],
};
$lei->{auth}->op_merge($ops, $l2m) if $l2m && $lei->{auth};
+ my $od = PublicInbox::OnDestroy->new($$, \&delete_pkt_op, $lei);
($lei->{pkt_op_c}, $lei->{pkt_op_p}) = PublicInbox::PktOp->pair($ops);
$lei->{1}->autoflush(1);
$lei->start_pager if delete $lei->{need_pager};