diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-03-14 00:23:22 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-03-14 16:13:30 +0100 |
commit | ac85576a8799ec12036bfb8bb93ac48f96830f1f (patch) | |
tree | 769db0131ede6f433594da5286b552a694cd6d4e /Bugzilla/Elastic.pm | |
parent | c56b9339af827fea16217832d93b266a27294acf (diff) | |
download | bugzilla-ac85576a8799ec12036bfb8bb93ac48f96830f1f.tar.gz bugzilla-ac85576a8799ec12036bfb8bb93ac48f96830f1f.tar.xz |
Revert "Bug 1307485 - Add code to run a subset of buglist.cgi search queries against the ES backend"
This reverts commit 9c26c01867ca3e2af1e70c051140eea59c68c500.
Diffstat (limited to 'Bugzilla/Elastic.pm')
-rw-r--r-- | Bugzilla/Elastic.pm | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/Bugzilla/Elastic.pm b/Bugzilla/Elastic.pm deleted file mode 100644 index 6384269fd..000000000 --- a/Bugzilla/Elastic.pm +++ /dev/null @@ -1,47 +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; -use 5.10.1; -use Moo; - -use Bugzilla::Elastic::Search; -use Bugzilla::Util qw(trick_taint); - -with 'Bugzilla::Elastic::Role::HasClient'; -with 'Bugzilla::Elastic::Role::HasIndexName'; - -sub suggest_users { - my ($self, $text) = @_; - my $field = 'suggest_user'; - if ($text =~ /^:(.+)$/) { - $text = $1; - $field = 'suggest_nick'; - } - - my $result = eval { - $self->client->suggest( - index => $self->index_name, - body => { - $field => { - text => $text, - completion => { field => $field, size => 25 }, - } - } - ); - }; - if (defined $result) { - return [ map { $_->{payload} } @{$result->{$field}[0]{options}} ]; - } - else { - warn "suggest_users error: $@"; - my $users = Bugzilla::User::match($text, 25, 0); - return [ map { { real_name => $_->name, name => $_->login } } @$users]; - } -} - - -1; |