Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //conf
- return [
- 'settings' => [
- 'number_of_replicas' => 0,
- 'number_of_shards' => 1,
- 'analysis' =>
- [
- 'filter' =>
- [
- 'stopwords_ru' =>
- [
- 'stopwords' => '_russian_',
- 'type' => 'stop',
- 'ignore_case' => true,
- ],
- 'tag_filter' =>
- [
- 'type' => 'word_delimiter',
- 'type_table' =>
- [
- 0 => '# => ALPHA',
- 1 => '@ => ALPHA',
- ],
- ],
- 'custom_word_delimiter' =>
- [
- 'catenate_all' => true,
- 'catenate_words' => true,
- 'catenate_numbers' => false,
- 'generate_word_parts' => true,
- 'split_on_numerics' => false,
- 'generate_number_parts' => true,
- 'preserve_original' => true,
- 'type' => 'word_delimiter',
- 'split_on_case_change' => true,
- ],
- ],
- 'char_filter' =>
- [
- 'ru' =>
- [
- 'type' => 'mapping',
- 'mappings' =>
- [
- 0 => 'ะ=>ะ',
- 1 => 'ั=>ะต',
- ],
- ],
- ],
- 'analyzer' =>
- [
- 'default_index' =>
- [
- 'filter' =>
- [
- 0 => 'stopwords_ru',
- 1 => 'custom_word_delimiter',
- 2 => 'lowercase',
- 3 => 'russian_morphology',
- 4 => 'english_morphology',
- ],
- 'alias' =>
- [
- 0 => 'index_ru',
- ],
- 'char_filter' =>
- [
- 0 => 'ru',
- ],
- 'type' => 'custom',
- 'tokenizer' => 'nGram',
- ],
- 'hl' =>
- [
- 'filter' =>
- [
- 'lowercase'
- ],
- 'char_filter' =>
- [
- 0 => 'ru',
- ],
- 'type' => 'custom',
- 'tokenizer' => 'nGram_suggest',
- ],
- 'default_search' =>
- [
- 'filter' =>
- [
- 'stopwords_ru',
- 'custom_word_delimiter',
- 'lowercase',
- 'russian_morphology',
- 'english_morphology',
- ],
- 'alias' =>
- [
- 0 => 'search_ru',
- ],
- 'char_filter' =>
- [
- 0 => 'ru',
- ],
- 'type' => 'custom',
- 'tokenizer' => 'standard',
- ],
- 'tag_analyzer' =>
- [
- 'filter' =>
- [
- 0 => 'tag_filter',
- 1 => 'russian_morphology',
- 2 => 'english_morphology',
- ],
- 'alias' =>
- [
- 0 => 'tag',
- ],
- 'type' => 'custom',
- 'tokenizer' => 'nGram',
- ],
- ],
- 'tokenizer' =>
- [
- 'nGram' =>
- [
- 'type' => 'nGram',
- 'max_gram' => 20,
- 'min_gram' => 4,
- ],
- 'nGram_suggest' =>
- [
- 'type' => 'nGram',
- 'max_gram' => 15,
- 'min_gram' => 3,
- ],
- ],
- ]
- ]
- ];
- }
Add Comment
Please, Sign In to add comment