Last active
April 12, 2018 11:32
-
-
Save karasugawasu/58c7a4e6f39b97e7129c35e0b52764bf to your computer and use it in GitHub Desktop.
Mastodon Kuromoji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/api/v1/search_controller.rb | |
RESULTS_LIMIT = 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/chewy/statuses_index.rb | |
class StatusesIndex < Chewy::Index | |
settings index: { refresh_interval: '15m' }, analysis: { | |
tokenizer: { | |
kuromoji_user_dict: { | |
type: 'kuromoji_neologd_tokenizer', | |
user_dictionary: 'userdic.txt', | |
}, | |
}, | |
analyzer: { | |
content: { | |
type: 'custom', | |
tokenizer: 'kuromoji_neologd_tokenizer', | |
filter: %w( | |
kuromoji_neologd_baseform | |
kuromoji_neologd_stemmer | |
cjk_width | |
lowercase | |
), | |
}, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment