Laravel's package based on Elasticsearch - Elasticquent, the setting problem of using ik word segmentation
PHP中文网
PHP中文网 2017-05-16 16:52:35
0
1
681

Use Laravel's Elasticsearch-based package (https://github.com/elasticquent/Elasticquent#indexes-and-mapping),

question:

1. When the following configuration uses ik word segmentation, how should it be set?
2. What are the concepts and functions of analysis, filter, and analyzer in the following code?

    protected $indexSettings = [
        'analysis' => [
            'char_filter' => [
                'replace' => [
                    'type' => 'mapping',
                    'mappings' => [
                        '&=> and '
                    ],
                ],
            ],
            'filter' => [
                'word_delimiter' => [
                    'type' => 'word_delimiter',
                    'split_on_numerics' => false,
                    'split_on_case_change' => true,
                    'generate_word_parts' => true,
                    'generate_number_parts' => true,
                    'catenate_all' => true,
                    'preserve_original' => true,
                    'catenate_numbers' => true,
                ]
            ],
            'analyzer' => [
                'default' => [
                    'type' => 'custom',
                    'char_filter' => [
                        'html_strip',
                        'replace',
                    ],
                    'tokenizer' => 'whitespace',
                    'filter' => [
                        'lowercase',
                        'word_delimiter',
                    ],
                ],
            ],
        ],
    ];
PHP中文网
PHP中文网

认证0级讲师

reply all(1)
过去多啦不再A梦

Analysis, filter, analyzer, plus Chinese word segmentation and pinyin, this is already a huge amount of knowledge.
Why don’t you start from the manual? Although I have just come into contact with elastic, I have spent a lot of time studying the manual.
After all, this thing is huge and not so easy to get started

Chinese manual (version 2.x): http://es.xiaoleilu.com
Official manual: https://www.elastic.co/guide/...

After reading the Chinese manual, I slowly started to read the official manual, and gradually gained some understanding of the above analyzers.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!