1.standard analyzer 标准分析器
由以下使用分词器和分词过滤器组成
POST _analyze
{
"analyzer": "standard",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}
分词结果:
[ the, 2, quick, brown, foxes, jumped, over, the, lazy, dog's, bone ]
自动小写化分词,默认不适用停用词,可配置三个参数
(1)单个词最大长度(max_token_length 默认255,超过则按照255切分)
(2)停用词(stopwords 即配置过滤词如the to等 默认为_none_)
(3)停用词文件路径(stopwords_path 默认没配)
修改配置,需新建一个分析器,如下
PUT my_index
{
"settings": {
"analysis": {
"analyzer": {
"my_standard_analyzer": {
"type": "standard",
"max_token_length": 10,
"stopwords": "_english_"
}
}
}
}
}
通过以上配置,在my_index中新增了一个my_standard_analyzer分析器,