+ $smsg->{eidx_key} = $ibx->eidx_key if $ibx;
+ $self->add_message($eml, $smsg);
+ }
+}
+
+sub shard_add_eidx_info {
+ my ($self, $docid, $eidx_key, $eml) = @_;
+ if (my $w = $self->{w}) {
+ my $hdr = $eml->header_obj->as_string;
+ my $len = length($hdr);
+ print $w "+X $len $docid $eidx_key\n", $hdr or
+ die "failed to write shard: $!";
+ } else {
+ $self->add_eidx_info($docid, $eidx_key, $eml);
+ }
+}
+
+sub shard_remove_eidx_info {
+ my ($self, $docid, $eidx_key, $eml) = @_;
+ if (my $w = $self->{w}) {
+ my $hdr = $eml ? $eml->header_obj->as_string : '';
+ my $len = length($hdr);
+ print $w "-X $len $docid $eidx_key\n", $hdr or
+ die "failed to write shard: $!";
+ } else {
+ $self->remove_eidx_info($docid, $eidx_key, $eml);