summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-03-14 00:23:22 +0100
committerDylan William Hardison <dylan@hardison.net>2017-03-14 16:13:30 +0100
commitac85576a8799ec12036bfb8bb93ac48f96830f1f (patch)
tree769db0131ede6f433594da5286b552a694cd6d4e /Bugzilla/User.pm
parentc56b9339af827fea16217832d93b266a27294acf (diff)
downloadbugzilla-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"
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index e8ddc0be7..69885f57c 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -128,7 +128,7 @@ with 'Bugzilla::Elastic::Role::Object';
sub ES_TYPE { 'user' }
-sub ES_OBJECTS_AT_ONCE { 5000 }
+sub ES_OBJECTS_AT_ONCE { 2000 }
sub ES_SELECT_UPDATED_SQL {
my ($class, $mtime) = @_;
@@ -150,7 +150,7 @@ sub ES_SELECT_ALL_SQL {
my $id = $class->ID_FIELD;
my $table = $class->DB_TABLE;
- return ("SELECT $id FROM $table WHERE $id > ? AND is_enabled AND NOT disabledtext ORDER BY $id", [$last_id // 0]);
+ return ("SELECT $id FROM $table WHERE $id > ? AND is_enabled ORDER BY $id", [$last_id // 0]);
}
sub ES_PROPERTIES {
@@ -175,6 +175,7 @@ sub ES_PROPERTIES {
sub es_document {
my ( $self, $timestamp ) = @_;
+ my $weight = eval { $self->last_activity_ts ? datetime_from($self->last_activity_ts)->epoch : 0 } // 0;
my $doc = {
login => $self->login,
name => $self->name,
@@ -183,6 +184,7 @@ sub es_document {
input => [ $self->login, $self->name ],
output => $self->identity,
payload => { name => $self->login, real_name => $self->name },
+ weight => $weight,
},
};
if ($self->name && $self->name =~ /:(\w+)/) {
@@ -191,6 +193,7 @@ sub es_document {
input => [ $ircnick ],
output => $self->login,
payload => { name => $self->login, real_name => $self->name, ircnick => $ircnick },
+ weight => $weight,
};
}