summaryrefslogtreecommitdiffstats
path: root/scripts/suggest-user.pl
blob: dcf24da87f52335860ae87b11c52fa0ee3f76dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
use strict;
use warnings;
use FindBin qw($RealBin);
use lib ($RealBin);
use Bugzilla;
use Search::Elasticsearch;
use Bugzilla::Elastic;

my $elastic = Bugzilla::Elastic->new(
    es_client => Search::Elasticsearch->new()
);
my $user = Bugzilla::User->check({name => 'dylan@mozilla.com'});
Bugzilla->set_user($user);
my $users;

for (1..4) {
    $users = $elastic->suggest_users($ARGV[0]);
}
print "$_->{name}\n" for @$users;