diff options
-rw-r--r-- | Bugzilla/Elastic/Indexer.pm | 1 | ||||
-rw-r--r-- | Bugzilla/User.pm | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Bugzilla/Elastic/Indexer.pm b/Bugzilla/Elastic/Indexer.pm index ab6c5dbfa..46eb8f648 100644 --- a/Bugzilla/Elastic/Indexer.pm +++ b/Bugzilla/Elastic/Indexer.pm @@ -184,6 +184,7 @@ sub bulk_load { my $new_ids = $self->_select_all_ids($class, $last_id); my $updated_ids = $self->_select_updated_ids($class, $last_mtime); + $self->put_mapping($class); $self->_bulk_load_ids($bulk, $class, $new_ids) if @$new_ids; $self->_bulk_load_ids($bulk, $class, $updated_ids) if @$updated_ids; diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index a3a78395a..2d7f38640 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -175,21 +175,23 @@ sub ES_PROPERTIES { sub es_document { my ( $self, $timestamp ) = @_; my $doc = { - login => $self->login, - name => $self->name, - is_enabled => $self->is_enabled, + login => $self->login, + name => $self->name, + is_enabled => $self->is_enabled, suggest_user => { input => [ $self->login, $self->name ], output => $self->identity, payload => { name => $self->login, real_name => $self->name }, }, }; - if ($self->name && $self->name =~ /:(\w+)/) { - my $ircnick = $1; + my $name = $self->name; + my @nicks = defined($name) ? ( $name =~ /:(\w+)\b/mg ) : (); + + if (@nicks) { $doc->{suggest_nick} = { - input => [ $ircnick ], + input => \@nicks, output => $self->login, - payload => { name => $self->login, real_name => $self->name, ircnick => $ircnick }, + payload => { name => $self->login, real_name => $self->name }, }; } |