summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.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/Bug.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/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm47
1 files changed, 31 insertions, 16 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index bc099f76e..cba973863 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -303,15 +303,19 @@ with 'Bugzilla::Elastic::Role::Object';
sub ES_TYPE {'bug'}
sub _bz_field {
- my ($field, @fields) = @_;
+ my ($field, $type, $analyzer, @fields) = @_;
return (
$field => {
- type => 'string',
- analyzer => 'bz_text_analyzer',
+ type => $type,
+ analyzer => $analyzer,
fields => {
+ raw => {
+ type => 'string',
+ index => 'not_analyzed',
+ },
eq => {
- type => 'string',
+ type => 'string',
analyzer => 'bz_equals_analyzer',
},
@fields,
@@ -320,20 +324,32 @@ sub _bz_field {
);
}
+sub _bz_text_field {
+ my ($field) = @_;
+
+ return _bz_field($field, 'string', 'bz_text_analyzer');
+}
+
+sub _bz_substring_field {
+ my ($field, @rest) = @_;
+
+ return _bz_field($field, 'string', 'bz_substring_analyzer', @rest);
+}
+
sub ES_PROPERTIES {
return {
- _bz_field('priority'),
- _bz_field('bug_severity'),
- _bz_field('bug_status'),
- _bz_field('resolution'),
+ priority => { type => 'string', analyzer => 'keyword' },
+ bug_severity => { type => 'string', analyzer => 'keyword' },
+ bug_status => { type => 'string', analyzer => 'keyword' },
+ resolution => { type => 'string', analyzer => 'keyword' },
+ keywords => { type => 'string' },
status_whiteboard => { type => 'string', analyzer => 'whiteboard_shingle_tokens' },
delta_ts => { type => 'string', index => 'not_analyzed' },
- _bz_field('product'),
- _bz_field('component'),
- _bz_field('classification'),
- _bz_field('short_desc'),
- _bz_field('assigned_to'),
- _bz_field('reporter'),
+ _bz_substring_field('product'),
+ _bz_substring_field('component'),
+ _bz_substring_field('classification'),
+ _bz_text_field('short_desc'),
+ _bz_substring_field('assigned_to'),
};
}
@@ -410,7 +426,7 @@ sub es_document {
bug_id => $self->id,
product => $self->product_obj->name,
alias => $self->alias,
- keywords => [ map { $_->name } @{$self->keyword_objects} ],
+ keywords => $self->keywords,
priority => $self->priority,
bug_status => $self->bug_status,
resolution => $self->resolution,
@@ -419,7 +435,6 @@ sub es_document {
status_whiteboard => $self->status_whiteboard,
short_desc => $self->short_desc,
assigned_to => $self->assigned_to->login,
- reporter => $self->reporter->login,
delta_ts => $self->delta_ts,
bug_severity => $self->bug_severity,
};