diff options
Diffstat (limited to 'Bugzilla/Elastic/Role')
-rw-r--r-- | Bugzilla/Elastic/Role/ChildObject.pm | 6 | ||||
-rw-r--r-- | Bugzilla/Elastic/Role/HasIndexName.pm | 16 | ||||
-rw-r--r-- | Bugzilla/Elastic/Role/Object.pm | 4 |
3 files changed, 8 insertions, 18 deletions
diff --git a/Bugzilla/Elastic/Role/ChildObject.pm b/Bugzilla/Elastic/Role/ChildObject.pm index 1f7a7483a..9735cc1ed 100644 --- a/Bugzilla/Elastic/Role/ChildObject.pm +++ b/Bugzilla/Elastic/Role/ChildObject.pm @@ -11,6 +11,10 @@ use Role::Tiny; with 'Bugzilla::Elastic::Role::Object'; -requires qw(ES_PARENT_TYPE es_parent_id); +requires qw(ES_PARENT_CLASS es_parent_id); + +sub ES_PARENT_TYPE { $_[0]->ES_PARENT_CLASS->ES_TYPE } +sub ES_INDEX { $_[0]->ES_PARENT_CLASS->ES_INDEX } +sub ES_SETTINGS { $_[0]->ES_PARENT_CLASS->ES_SETTINGS } 1; diff --git a/Bugzilla/Elastic/Role/HasIndexName.pm b/Bugzilla/Elastic/Role/HasIndexName.pm deleted file mode 100644 index eaff339cd..000000000 --- a/Bugzilla/Elastic/Role/HasIndexName.pm +++ /dev/null @@ -1,16 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Elastic::Role::HasIndexName; - -use 5.10.1; -use Moo::Role; -use Search::Elasticsearch; - -has 'index_name' => ( is => 'ro', default => sub { Bugzilla->params->{elasticsearch_index} } ); - - -1; diff --git a/Bugzilla/Elastic/Role/Object.pm b/Bugzilla/Elastic/Role/Object.pm index ad5ab002b..c51948ee9 100644 --- a/Bugzilla/Elastic/Role/Object.pm +++ b/Bugzilla/Elastic/Role/Object.pm @@ -9,7 +9,7 @@ package Bugzilla::Elastic::Role::Object; use 5.10.1; use Role::Tiny; -requires qw(ES_TYPE ES_PROPERTIES es_document); +requires qw(ES_TYPE ES_INDEX ES_SETTINGS ES_PROPERTIES es_document); requires qw(ID_FIELD DB_TABLE); sub ES_OBJECTS_AT_ONCE { 100 } @@ -45,4 +45,6 @@ around 'es_document' => sub { return $doc; }; + + 1; |