当前位置:网站首页>Es custom analyzer
Es custom analyzer
2022-07-21 19:25:00 【Wen Xiaowu】
Analyzer definition
An analyzer is a wrapper that combines three functions , The three functions are executed in the following order :
- Character filter Process the initial input string , You can filter out specific characters , Or convert to custom characters
- Word segmentation is The word breaker divides the string into single entries , An parser must have a unique word breaker
- Word unit filter The entries pass through the word unit filter in order , Word unit filters can be modified , Add or remove entries . for example :lowercase filter , Will convert all letters to lowercase .
Custom Analyzer
stay analysis Set the character filter in the corresponding position below 、 Word splitters and word unit filters , The format is :
PUT /my_index
{
"settings": {
"analysis": {
"char_filter": { ... Character filter ... },
"tokenizer": { ... Word segmentation is ... },
"filter": { ... Word unit filter ... },
"analyzer": { ... analyzer ... }
}
}
}
Definition in practical application :
{
"analysis": {
"tokenizer": {
"filter": {
"my_stopwords": {
"type": "stop",
"stopwords": [
"the",
"a"
]
}
},
"trigram_tokenizer": {
"type": "ngram",
"min_gram": 1,
"max_gram": 3,
"token_chars": [
"letter",
"digit"
]
}
},
"analyzer": {
"trigram_analyzer": {
"tokenizer": "trigram_tokenizer",
"filter": [
"lowercase",“my_stopwords”
]
}
}
}
}
Define an analyzer trigram_analyzer, Use word splitter tokenizer, use ngram As this unit filter , The character filter only retains letters letter And number digit, And convert to lowercase letters lowercase, Get rid of the and a
边栏推荐
- Phpstudy_pro搭建Sqli-labs靶场,进行SQL注入测试
- Top 10 NFTs at present
- Web APIs DOM- 网页特效篇-元素大小和位置
- Distributed General service layer cache design
- [performance optimization] MySQL common slow query analysis tools
- Software testing interview question: what is the task of testers in the process of software development?
- Light the first LED
- [qt primer] Application of window classes
- 不想醒来因为好吃
- MYSQL09_精讲数据库数据类型
猜你喜欢
LBA转换成CHS公式
SAP smartforms print failure message type: ssfcomposer message number: 601 (currency and number field setting reference and format)
Distributed Common architectures and service splitting
Plantuml draw link diagram
FTP服务配置
分布式.达到什么指标才算高并发
分布式.BASE理论
分布式.高并发概念和设计目标
FTP service configuration
Top 10 NFTs at present
随机推荐
MYSQL06_sql99的7种JOIN操作、union all
Software testing interview question: what is the strategy of software testing?
MySQL优化总结 一
5. Customize global AuthenticationManager
LBA converted to CHS formula
Pytorch deep learning practice lesson 2 / assignment (linear model)
Filter listener
Matrix
According to the framework's swagger interface document
toast_ tuple_ Question of threshold
初识ClickHouse——安装与入门
Spark RDD, application case of spark SQL
Arduino I2C for TCA9548A应答扫描程序
regular expression
hcip第二天实验
Ardunio development - I2C protocol communication - control 2x16lcd
Plantuml draw link diagram
分布式.数据库架构
TiDB 分布式批量解决方案
L1-008 sum integer segments