summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Elastic/Indexer.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-03-21 04:08:26 +0100
committerDylan William Hardison <dylan@hardison.net>2017-03-21 04:08:26 +0100
commitb921e3142e37977298571a4229faca4e1794017d (patch)
treec965352b0db57f0d73f12ba2fd818845566dbe8b /Bugzilla/Elastic/Indexer.pm
parente53de8c34e12e18ecea98ad97775893f083beff7 (diff)
downloadbugzilla-b921e3142e37977298571a4229faca4e1794017d.tar.gz
bugzilla-b921e3142e37977298571a4229faca4e1794017d.tar.xz
Bug 1307485 - Add code to run a subset of buglist.cgi search queries against the ES backend
Skipping this for this week's push.
Diffstat (limited to 'Bugzilla/Elastic/Indexer.pm')
-rw-r--r--Bugzilla/Elastic/Indexer.pm29
1 files changed, 17 insertions, 12 deletions
diff --git a/Bugzilla/Elastic/Indexer.pm b/Bugzilla/Elastic/Indexer.pm
index dd71a7198..82f946af9 100644
--- a/Bugzilla/Elastic/Indexer.pm
+++ b/Bugzilla/Elastic/Indexer.pm
@@ -23,7 +23,7 @@ has 'mtime' => (
has 'shadow_dbh' => ( is => 'lazy' );
has 'debug_sql' => (
- is => 'ro',
+ is => 'ro',
default => 0,
);
@@ -40,24 +40,24 @@ sub create_index {
index => $self->index_name,
body => {
settings => {
- number_of_shards => 2,
+ number_of_shards => 1,
analysis => {
- filter => {
- asciifolding_original => {
- type => "asciifolding",
- preserve_original => \1,
- },
- },
analyzer => {
folding => {
+ type => 'standard',
tokenizer => 'standard',
- filter => ['standard', 'lowercase', 'asciifolding_original'],
+ filter => [ 'lowercase', 'asciifolding' ]
},
bz_text_analyzer => {
type => 'standard',
filter => ['lowercase', 'stop'],
max_token_length => '20'
},
+ bz_substring_analyzer => {
+ type => 'custom',
+ filter => ['lowercase'],
+ tokenizer => 'bz_ngram_tokenizer',
+ },
bz_equals_analyzer => {
type => 'custom',
filter => ['lowercase'],
@@ -71,20 +71,25 @@ sub create_index {
whiteboard_shingle_words => {
type => 'custom',
tokenizer => 'whiteboard_words_pattern',
- filter => ['stop', 'shingle', 'lowercase']
+ filter => ['stop', 'shingle']
},
whiteboard_tokens => {
type => 'custom',
tokenizer => 'whiteboard_tokens_pattern',
- filter => ['stop', 'lowercase']
+ filter => ['stop']
},
whiteboard_shingle_tokens => {
type => 'custom',
tokenizer => 'whiteboard_tokens_pattern',
- filter => ['stop', 'shingle', 'lowercase']
+ filter => ['stop', 'shingle']
}
},
tokenizer => {
+ bz_ngram_tokenizer => {
+ type => 'nGram',
+ min_ngram => 2,
+ max_ngram => 25,
+ },
whiteboard_tokens_pattern => {
type => 'pattern',
pattern => '\\s*([,;]*\\[|\\][\\s\\[]*|[;,])\\s*'