Created
March 17, 2017 11:52
-
-
Save bardex/fd91f92ef1cdd4b036b1d5de88e7888d to your computer and use it in GitHub Desktop.
ElasticSearch настройки для русской морфологии. Проверено на ES версии 5.* Требуется плагин https://github.com/imotov/elasticsearch-analysis-morphology
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
return [ | |
'analysis' => [ | |
'char_filter' => [ | |
'ru' => [ | |
'type' => 'mapping', | |
'mappings' => ['Ё=>Е','ё=>е'], | |
], | |
], | |
'analyzer' => [ | |
'default' => [ | |
'alias' => ['index_ru'], | |
'type' => 'custom', | |
"tokenizer" => "standard", | |
'filter' => ['stopwords_ru','stop','custom_word_delimiter','lowercase', 'snowball', 'russian_morphology','english_morphology'], | |
'char_filter' => ['ru'], | |
], | |
'default_search' => [ | |
'alias' => ['search_ru'], | |
'type' => 'custom', | |
'tokenizer' => 'standard', | |
'filter' => ['stopwords_ru','stop','custom_word_delimiter','lowercase', 'snowball','russian_morphology','english_morphology'], | |
'char_filter' => ['ru'] | |
] | |
], | |
'filter' => [ | |
'stopwords_ru' => [ | |
'type' => 'stop', | |
'stopwords' => ['а','без','более','бы','был','была','были','было','быть','в','вам','вас','весь','во', | |
'вот','все','всего','всех','вы','где','да','даже','для','до','его','ее','если','есть', | |
'еще','же','за','здесь','и','из','или','им','их','к','как','ко','когда','кто','ли', | |
'либо','мне','может','мы','на','надо','наш','не','него','нее','нет','ни','них','но', | |
'ну','о','об','однако','он','она','они','оно','от','очень','по','под','при','с','со', | |
'так','также','такой','там','те','тем','то','того','тоже','той','только','том','ты', | |
'у','уже','хотя','чего','чей','чем','что','чтобы','чье','чья','эта','эти','это','я'], | |
'ignore_case' => true, | |
], | |
'custom_word_delimiter' => [ | |
'type' => 'word_delimiter', | |
'generate_word_parts' => true, | |
'generate_number_parts' => true, | |
'catenate_words' => true, | |
'catenate_numbers' => false, | |
'catenate_all' => true, | |
'split_on_case_change' => true, | |
'preserve_original' => true, | |
'split_on_numerics' => false, | |
], | |
], | |
] | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment