From 96b4da8b39cbc09f30b29c9da3a10cb9803866fb Mon Sep 17 00:00:00 2001 From: wuyingren Date: Thu, 30 Apr 2020 01:22:11 +0800 Subject: [PATCH] change elasticsearch tokenizer to support chinese full-text search --- app/chewy/accounts_index.rb | 2 +- app/chewy/statuses_index.rb | 2 +- app/chewy/tags_index.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/chewy/accounts_index.rb b/app/chewy/accounts_index.rb index b814e009e..64b4fff9b 100644 --- a/app/chewy/accounts_index.rb +++ b/app/chewy/accounts_index.rb @@ -4,7 +4,7 @@ class AccountsIndex < Chewy::Index settings index: { refresh_interval: '5m' }, analysis: { analyzer: { content: { - tokenizer: 'whitespace', + tokenizer: 'ik_max_word', filter: %w(lowercase asciifolding cjk_width), }, diff --git a/app/chewy/statuses_index.rb b/app/chewy/statuses_index.rb index bec9ed88b..ac3295b64 100644 --- a/app/chewy/statuses_index.rb +++ b/app/chewy/statuses_index.rb @@ -18,7 +18,7 @@ class StatusesIndex < Chewy::Index }, analyzer: { content: { - tokenizer: 'uax_url_email', + tokenizer: 'ik_max_word', filter: %w( english_possessive_stemmer lowercase diff --git a/app/chewy/tags_index.rb b/app/chewy/tags_index.rb index 300fc128f..292d963ff 100644 --- a/app/chewy/tags_index.rb +++ b/app/chewy/tags_index.rb @@ -4,7 +4,7 @@ class TagsIndex < Chewy::Index settings index: { refresh_interval: '15m' }, analysis: { analyzer: { content: { - tokenizer: 'keyword', + tokenizer: 'ik_max_word', filter: %w(lowercase asciifolding cjk_width), },