Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled feature full-text search #2128

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions app/chewy/public_statuses_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
class PublicStatusesIndex < Chewy::Index
settings index: index_preset(refresh_interval: '30s', number_of_shards: 5), analysis: {
filter: {
kuromoji_search_split: {
type: 'sudachi_split',
mode: 'search',
},

english_stop: {
type: 'stop',
stopwords: '_english_',
Expand All @@ -19,22 +24,30 @@ class PublicStatusesIndex < Chewy::Index
},
},

tokenizer: {
sudachi_tokenizer: {
type: 'sudachi_tokenizer',
discard_punctuation: true,
additional_settings: '{"systemDict": "system_full.dic"}',
},
},

analyzer: {
verbatim: {
tokenizer: 'uax_url_email',
filter: %w(lowercase),
},

content: {
tokenizer: 'standard',
tokenizer: 'sudachi_tokenizer',
filter: %w(
lowercase
asciifolding
cjk_width
elision
english_possessive_stemmer
english_stop
english_stemmer
kuromoji_search_split
sudachi_part_of_speech
sudachi_ja_stop
sudachi_normalizedform
),
},

Expand Down
23 changes: 18 additions & 5 deletions app/chewy/statuses_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
class StatusesIndex < Chewy::Index
settings index: index_preset(refresh_interval: '30s', number_of_shards: 5), analysis: {
filter: {
kuromoji_search_split: {
type: 'sudachi_split',
mode: 'search',
},

english_stop: {
type: 'stop',
stopwords: '_english_',
Expand All @@ -19,22 +24,30 @@ class StatusesIndex < Chewy::Index
},
},

tokenizer: {
sudachi_tokenizer: {
type: 'sudachi_tokenizer',
discard_punctuation: true,
additional_settings: '{"systemDict": "system_full.dic"}',
},
},

analyzer: {
verbatim: {
tokenizer: 'uax_url_email',
filter: %w(lowercase),
},

content: {
tokenizer: 'standard',
tokenizer: 'sudachi_tokenizer',
filter: %w(
lowercase
asciifolding
cjk_width
elision
english_possessive_stemmer
english_stop
english_stemmer
kuromoji_search_split
sudachi_part_of_speech
sudachi_ja_stop
sudachi_normalizedform
),
},

Expand Down
Loading