diff --git a/app/chewy/accounts_index.rb b/app/chewy/accounts_index.rb index 59f2f991f2..ef103d67fb 100644 --- a/app/chewy/accounts_index.rb +++ b/app/chewy/accounts_index.rb @@ -23,13 +23,22 @@ class AccountsIndex < Chewy::Index analyzer: { natural: { - tokenizer: 'standard', + tokenizer: 'kuromoji', + type: 'custom', + char_filter: %w( + icu_normalizer + html_strip + kuromoji_iteration_mark + ), filter: %w( + english_possessive_stemmer lowercase asciifolding + kuromoji_stemmer + kuromoji_number + kuromoji_baseform + icu_normalizer cjk_width - elision - english_possessive_stemmer english_stop english_stemmer ), @@ -52,6 +61,10 @@ class AccountsIndex < Chewy::Index min_gram: 1, max_gram: 15, }, + kuromoji: { + type: 'kuromoji_tokenizer', + mode: 'search', + }, }, } diff --git a/app/chewy/public_statuses_index.rb b/app/chewy/public_statuses_index.rb index 076f72e525..7b40997c25 100644 --- a/app/chewy/public_statuses_index.rb +++ b/app/chewy/public_statuses_index.rb @@ -20,7 +20,12 @@ class PublicStatusesIndex < Chewy::Index language: 'possessive_english', }, }, - + tokenizer: { + kuromoji: { + type: 'kuromoji_tokenizer', + mode: 'search', + }, + }, analyzer: { verbatim: { tokenizer: 'uax_url_email', @@ -28,13 +33,22 @@ class PublicStatusesIndex < Chewy::Index }, content: { - tokenizer: 'standard', + tokenizer: 'kuromoji', + type: 'custom', + char_filter: %w( + icu_normalizer + html_strip + kuromoji_iteration_mark + ), filter: %w( + english_possessive_stemmer lowercase asciifolding + kuromoji_stemmer + kuromoji_number + kuromoji_baseform + icu_normalizer cjk_width - elision - english_possessive_stemmer english_stop english_stemmer ), diff --git a/app/chewy/statuses_index.rb b/app/chewy/statuses_index.rb index fcec20ff5c..6b1688dd8e 100644 --- a/app/chewy/statuses_index.rb +++ b/app/chewy/statuses_index.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class StatusesIndex < Chewy::Index + include FormattingHelper include DatetimeClampingConcern settings index: index_preset(refresh_interval: '30s', number_of_shards: 5), analysis: { @@ -20,7 +21,12 @@ class StatusesIndex < Chewy::Index language: 'possessive_english', }, }, - + tokenizer: { + kuromoji: { + type: 'kuromoji_tokenizer', + mode: 'search', + }, + }, analyzer: { verbatim: { tokenizer: 'uax_url_email', @@ -28,13 +34,22 @@ class StatusesIndex < Chewy::Index }, content: { - tokenizer: 'standard', + tokenizer: 'kuromoji', + type: 'custom', + char_filter: %w( + icu_normalizer + html_strip + kuromoji_iteration_mark + ), filter: %w( + english_possessive_stemmer lowercase asciifolding + kuromoji_stemmer + kuromoji_number + kuromoji_baseform + icu_normalizer cjk_width - elision - english_possessive_stemmer english_stop english_stemmer ),