From da9c617eb5d8345409386b85b5d8c167fc0c55d7 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 20 Jul 2017 16:36:56 -0400 Subject: Bug 1381869 - Use separate elasticsearch index for Bugzilla::User This patch removes the concept of a single, bugzilla-wide index in favor of a per-class index. bugs and comments continue to use Bugzilla->params->{elasticsearch_index} but users use Bugzilla->params->{elasticsearch_index} . "_user". It is assured via the ChildObject trait (role) that comments will share the index with bugs, and we have kept the index for bugs/comments the same to avoid the multi-hour reindexing of production. Re-indexing users takes only five minutes. Subsequent work on this will allow use to version the index names and use aliases, but I wanted to keep this patch small. This patch also corrects some mistakes 1. $indexer->put_mapping() should not have been a public method. 2. Time::HiRes should be imported at the top of the file, not in a sub. --- Bugzilla/Elastic/Role/HasIndexName.pm | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 Bugzilla/Elastic/Role/HasIndexName.pm (limited to 'Bugzilla/Elastic/Role/HasIndexName.pm') 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; -- cgit v1.2.3-24-g4f1b