summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Elastic/Search.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-07-20 22:36:56 +0200
committerGitHub <noreply@github.com>2017-07-20 22:36:56 +0200
commitda9c617eb5d8345409386b85b5d8c167fc0c55d7 (patch)
tree0938a7253553df05d30df952d6fc2b6e1393743b /Bugzilla/Elastic/Search.pm
parent608ec172071f5adfe8eba9c83d42668520a2baea (diff)
downloadbugzilla-da9c617eb5d8345409386b85b5d8c167fc0c55d7.tar.gz
bugzilla-da9c617eb5d8345409386b85b5d8c167fc0c55d7.tar.xz
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.
Diffstat (limited to 'Bugzilla/Elastic/Search.pm')
-rw-r--r--Bugzilla/Elastic/Search.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/Bugzilla/Elastic/Search.pm b/Bugzilla/Elastic/Search.pm
index e1af91032..26ab71bec 100644
--- a/Bugzilla/Elastic/Search.pm
+++ b/Bugzilla/Elastic/Search.pm
@@ -31,7 +31,6 @@ has '_order' => ( is => 'lazy', init_arg => undef );
has 'invalid_order_columns' => ( is => 'lazy' );
with 'Bugzilla::Elastic::Role::HasClient';
-with 'Bugzilla::Elastic::Role::HasIndexName';
with 'Bugzilla::Elastic::Role::Search';
my @SUPPORTED_FIELDS = qw(
@@ -92,9 +91,9 @@ sub data {
my $body = $self->es_query;
my $result = eval {
$self->client->search(
- index => $self->index_name,
- type => 'bug',
- body => $body,
+ index => Bugzilla::Bug->ES_INDEX,
+ type => Bugzilla::Bug->ES_TYPE,
+ body => $body,
);
};
die $@ unless $result;