convert Chinese characters from Traditional to Simplified

This commit is contained in:
wuyingren 2020-04-30 10:30:06 +08:00
parent 96b4da8b39
commit 6f6f32a532
2 changed files with 18 additions and 0 deletions

View file

@ -16,6 +16,14 @@ class StatusesIndex < Chewy::Index
language: 'possessive_english',
},
},
char_filter: {
tsconvert: {
type: 'stconvert',
keep_both: false,
delimiter: '#',
convert_type: 't2s',
},
},
analyzer: {
content: {
tokenizer: 'ik_max_word',
@ -27,6 +35,7 @@ class StatusesIndex < Chewy::Index
english_stop
english_stemmer
),
char_filter: %w(tsconvert),
},
},
}

View file

@ -2,10 +2,19 @@
class TagsIndex < Chewy::Index
settings index: { refresh_interval: '15m' }, analysis: {
char_filter: {
tsconvert: {
type: 'stconvert',
keep_both: false,
delimiter: '#',
convert_type: 't2s',
},
},
analyzer: {
content: {
tokenizer: 'ik_max_word',
filter: %w(lowercase asciifolding cjk_width),
char_filter: %w(tsconvert),
},
edge_ngram: {