summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Comment.pm2
-rw-r--r--Bugzilla/Elastic/Indexer.pm2
-rw-r--r--Bugzilla/Elastic/Role/Object.pm6
3 files changed, 8 insertions, 2 deletions
diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm
index 23c1d3f85..f9a6f7d3a 100644
--- a/Bugzilla/Comment.pm
+++ b/Bugzilla/Comment.pm
@@ -119,7 +119,7 @@ sub ES_SELECT_UPDATED_SQL {
sub es_parent_id {
my ($self) = @_;
- return $self->bug_id,
+ return $self->ES_PARENT_CLASS->ES_TYPE . '_' . $self->bug_id,
}
sub es_document {
diff --git a/Bugzilla/Elastic/Indexer.pm b/Bugzilla/Elastic/Indexer.pm
index 36dd1dcb4..a9d796ae7 100644
--- a/Bugzilla/Elastic/Indexer.pm
+++ b/Bugzilla/Elastic/Indexer.pm
@@ -194,7 +194,7 @@ sub _bulk_load_ids {
my $objects = $class->new_from_list(\@ids);
foreach my $object (@$objects) {
my %doc = (
- id => $object->id,
+ id => $object->es_id,
source => scalar $object->es_document($mtime),
);
diff --git a/Bugzilla/Elastic/Role/Object.pm b/Bugzilla/Elastic/Role/Object.pm
index c51948ee9..674545d04 100644
--- a/Bugzilla/Elastic/Role/Object.pm
+++ b/Bugzilla/Elastic/Role/Object.pm
@@ -25,6 +25,11 @@ sub ES_SELECT_ALL_SQL {
requires qw(ES_SELECT_UPDATED_SQL);
+sub es_id {
+ my ($self) = @_;
+ return join('_', $self->ES_TYPE, $self->id);
+}
+
around 'ES_PROPERTIES' => sub {
my $orig = shift;
my $self = shift;
@@ -41,6 +46,7 @@ around 'es_document' => sub {
$doc->{es_mtime} = $mtime;
$doc->{$self->ID_FIELD} = $self->id;
+ $doc->{_id} = $self->es_id;
return $doc;
};