my $ibx = _ibx_for $self, $smsg;
$smsg->{eidx_key} = $ibx->eidx_key;
if ($self->{-need_xapian}) {
- my $idx = idx_shard($self, $docid);
- $idx->index_eml($eml, $smsg);
for my $x (reverse @$stable) {
my $lid = delete $x->{lid} // die 'BUG: no {lid}';
- @$lid and $idx->ipc_do('add_eidx_info_raw', $docid,
- _ibx_for($self, $x)->eidx_key,
- @$lid);
+ @$lid and push @{$smsg->{-eidx_more}},
+ [ _ibx_for($self, $x)->eidx_key, @$lid ]
}
+ idx_shard($self, $docid)->index_eml($eml, $smsg);
}
return if $nr == 1; # likely, all good
sub add_xapian ($$$$) {
my ($self, $eml, $smsg, $mids) = @_;
begin_txn_lazy($self);
- my $merge_vmd = delete $smsg->{-merge_vmd};
+ my ($merge_vmd, $eidx_more) = delete @$smsg{qw(-merge_vmd -eidx_more)};
my $doc = eml2doc($self, $eml, $smsg, $mids);
if (my $old = $merge_vmd ? _get_doc($self, $smsg->{num}) : undef) {
my @x = @VMD_MAP;
}
}
}
+ for (@$eidx_more) {
+ my ($eidx_key, @list_ids) = @$_;
+ add_bool_term($doc, 'O'.$eidx_key) if $eidx_key ne '.';
+ index_list_id_raw $self, $doc, @list_ids;
+ }
$self->{xdb}->replace_document($smsg->{num}, $doc);
}