Set up elasticsearch 7 to use sudachi

This commit is contained in:
noellabo 2019-06-28 05:50:16 +09:00
parent fed4eaf5f3
commit 40db10417c

View file

@ -2,31 +2,29 @@
class StatusesIndex < Chewy::Index class StatusesIndex < Chewy::Index
settings index: { refresh_interval: '15m' }, analysis: { settings index: { refresh_interval: '15m' }, analysis: {
filter: { tokenizer: {
english_stop: { sudachi_tokenizer: {
type: 'stop', type: 'sudachi_tokenizer',
stopwords: '_english_', discard_punctuation: true,
}, resources_path: '/etc/elasticsearch',
english_stemmer: { settings_path: '/etc/elasticsearch/sudachi.json',
type: 'stemmer', additional_settings: {
language: 'english', systemDict: 'system_full.dic',
}, userDict: [],
english_possessive_stemmer: { },
type: 'stemmer',
language: 'possessive_english',
}, },
}, },
analyzer: { analyzer: {
content: { content: {
tokenizer: 'uax_url_email',
filter: %w( filter: %w(
english_possessive_stemmer
lowercase lowercase
asciifolding
cjk_width cjk_width
english_stop sudachi_part_of_speech
english_stemmer sudachi_ja_stop
sudachi_baseform
), ),
tokenizer: 'sudachi_tokenizer',
type: 'custom',
}, },
}, },
} }