Skip to content

Commit bb8f841

Browse files
committed
Enable kuromoji in searching accounts
1 parent 1eefcec commit bb8f841

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
@@ -21,7 +21,12 @@ class AccountsIndex < Chewy::Index
2121

2222
analyzer: {
2323
natural: {
24-
tokenizer: 'standard',
24+
tokenizer: 'kuromoji_user_dict',
25+
char_filter: %w(
26+
icu_normalizer
27+
html_strip
28+
kuromoji_iteration_mark
29+
),
2530
filter: %w(
2631
lowercase
2732
asciifolding
@@ -30,6 +35,10 @@ class AccountsIndex < Chewy::Index
3035
english_possessive_stemmer
3136
english_stop
3237
english_stemmer
38+
kurojoji_stemmer
39+
kuromoji_number
40+
kuromoji_baseform
41+
icu_normalizer
3342
),
3443
},
3544

@@ -50,6 +59,12 @@ class AccountsIndex < Chewy::Index
5059
min_gram: 1,
5160
max_gram: 15,
5261
},
62+
63+
kuromoji_user_dict: {
64+
type: 'kuromoji_tokenizer',
65+
mode: 'search',
66+
user_dictionary: 'userdic.txt',
67+
},
5368
},
5469
}
5570

0 commit comments

Comments
 (0)