summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-03-07 23:47:36 +0100
committerDylan William Hardison <dylan@hardison.net>2017-03-07 23:49:02 +0100
commit9c26c01867ca3e2af1e70c051140eea59c68c500 (patch)
tree5b7b8a9e3f953a650ef1c3f07cabc4e71d750e42 /Bugzilla/Bug.pm
parent91248ef8f435814392896e247c45e09119ec6729 (diff)
downloadbugzilla-9c26c01867ca3e2af1e70c051140eea59c68c500.tar.gz
bugzilla-9c26c01867ca3e2af1e70c051140eea59c68c500.tar.xz
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, 16 insertions, 31 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index cba973863..bc099f76e 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -303,19 +303,15 @@ with 'Bugzilla::Elastic::Role::Object';
sub ES_TYPE {'bug'}
sub _bz_field {
- my ($field, $type, $analyzer, @fields) = @_;
+ my ($field, @fields) = @_;
return (
$field => {
- type => $type,
- analyzer => $analyzer,
+ type => 'string',
+ analyzer => 'bz_text_analyzer',
fields => {
- raw => {
- type => 'string',
- index => 'not_analyzed',
- },
eq => {
- type => 'string',
+ type => 'string',
analyzer => 'bz_equals_analyzer',
},
@fields,
@@ -324,32 +320,20 @@ 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 {
- 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' },
+ _bz_field('priority'),
+ _bz_field('bug_severity'),
+ _bz_field('bug_status'),
+ _bz_field('resolution'),
status_whiteboard => { type => 'string', analyzer => 'whiteboard_shingle_tokens' },
delta_ts => { type => 'string', index => 'not_analyzed' },
- _bz_substring_field('product'),
- _bz_substring_field('component'),
- _bz_substring_field('classification'),
- _bz_text_field('short_desc'),
- _bz_substring_field('assigned_to'),
+ _bz_field('product'),
+ _bz_field('component'),
+ _bz_field('classification'),
+ _bz_field('short_desc'),
+ _bz_field('assigned_to'),
+ _bz_field('reporter'),
};
}
@@ -426,7 +410,7 @@ sub es_document {
bug_id => $self->id,
product => $self->product_obj->name,
alias => $self->alias,
- keywords => $self->keywords,
+ keywords => [ map { $_->name } @{$self->keyword_objects} ],
priority => $self->priority,
bug_status => $self->bug_status,
resolution => $self->resolution,
@@ -435,6 +419,7 @@ 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,
};