- my ($self, $oid, $num) = @_;
- if (my $w = $self->{w}) { # triggers remove_by_oid in a shard child
- print $w "D $oid $num\n" or die "failed to write remove $!";
+ my ($self, $num) = @_;
+ if (my $w = $self->{w}) { # triggers remove_by_docid in a shard child
+ print $w "D $num\n" or die "failed to write remove $!";
+ } else { # same process
+ $self->remove_by_docid($num);
+ }
+}
+
+sub shard_set_keywords {
+ my ($self, $docid, @kw) = @_;
+ if (my $w = $self->{w}) { # triggers remove_by_docid in a shard child
+ print $w "=K $docid @kw\n" or die "failed to write: $!";
+ } else { # same process
+ $self->set_keywords($docid, @kw);
+ }
+}
+
+sub shard_remove_keywords {
+ my ($self, $docid, @kw) = @_;
+ if (my $w = $self->{w}) { # triggers remove_by_docid in a shard child
+ print $w "-K $docid @kw\n" or die "failed to write: $!";
+ } else { # same process
+ $self->remove_keywords($docid, @kw);
+ }
+}
+
+sub shard_add_keywords {
+ my ($self, $docid, @kw) = @_;
+ if (my $w = $self->{w}) { # triggers remove_by_docid in a shard child
+ print $w "+K $docid @kw\n" or die "failed to write: $!";