Skip to content

Commit 79cdc0d

Browse files
committed
Enable kuromoji in searching accounts
1 parent 22155c1 commit 79cdc0d

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

app/chewy/accounts_index.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ class AccountsIndex < Chewy::Index
2323

2424
analyzer: {
2525
natural: {
26-
tokenizer: 'standard',
26+
tokenizer: 'kuromoji_user_dict',
27+
char_filter: %w(
28+
icu_normalizer
29+
html_strip
30+
kuromoji_iteration_mark
31+
),
2732
filter: %w(
2833
lowercase
2934
asciifolding
@@ -32,6 +37,10 @@ class AccountsIndex < Chewy::Index
3237
english_possessive_stemmer
3338
english_stop
3439
english_stemmer
40+
kurojoji_stemmer
41+
kuromoji_number
42+
kuromoji_baseform
43+
icu_normalizer
3544
),
3645
},
3746

@@ -52,6 +61,12 @@ class AccountsIndex < Chewy::Index
5261
min_gram: 1,
5362
max_gram: 15,
5463
},
64+
65+
kuromoji_user_dict: {
66+
type: 'kuromoji_tokenizer',
67+
mode: 'search',
68+
user_dictionary: 'userdic.txt',
69+
},
5570
},
5671
}
5772

0 commit comments

Comments
 (0)