summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 2d7f38640..525733069 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -126,6 +126,11 @@ use constant EXTRA_REQUIRED_FIELDS => qw(is_enabled);
with 'Bugzilla::Elastic::Role::Object';
+sub ES_INDEX {
+ my ($class) = @_;
+ sprintf("%s_%s", Bugzilla->params->{elasticsearch_index}, $class->ES_TYPE);
+}
+
sub ES_TYPE { 'user' }
sub ES_OBJECTS_AT_ONCE { 5000 }
@@ -153,6 +158,31 @@ sub ES_SELECT_ALL_SQL {
return ("SELECT $id FROM $table WHERE $id > ? AND is_enabled AND NOT disabledtext ORDER BY $id", [$last_id // 0]);
}
+sub ES_SETTINGS {
+ return {
+ number_of_shards => 2,
+ analysis => {
+ filter => {
+ asciifolding_original => {
+ type => "asciifolding",
+ preserve_original => \1,
+ },
+ },
+ analyzer => {
+ autocomplete => {
+ type => 'custom',
+ tokenizer => 'keyword',
+ filter => [ 'lowercase', 'asciifolding_original' ],
+ },
+ folding => {
+ tokenizer => 'standard',
+ filter => [ 'standard', 'lowercase', 'asciifolding_original' ],
+ },
+ }
+ }
+ };
+}
+
sub ES_PROPERTIES {
return {
suggest_user => {