一组用于分析特定语言文本的分析器。 支持以下类型:, , , , , , ,, , , , , , , , , ,, , , , , , , ,, , , , , , , .
配置语言分析仪
Stopwords(停止词)
所有分析仪都支持在配置内部设置自定义停用词,也可以通过设置stopwords_path来使用外部的停用词。 检查Stop Analyzer了解更多详细信息。
Excluding words from stemming(排除词干)
stem_exclusion参数允许您指定不应该被阻止的小写字母数组。 在内部,通过将关键字设置为该值的keyword_marker token filter 来实现此功能
Reimplementing language analyzers(重新实现语言分析器)
内置语言分析器可以作为custom analyzers(如下所述)重新实现,以便自定义其行为。
笔记:如果您不打算排除单词被干扰(相当于上面的stem_exclusion参数),那么您应该从custom analyzer配置中删除keyword_marker token filter。
arabic 分析器
arabic 分析器可以如以下定制分析仪重新实现:
{
"settings": {
"analysis": {
"filter": {
"arabic_stop": {
"type": "stop",
"stopwords": "_arabic_" # 1
},
"arabic_keywords": {
"type": "keyword_marker",
"keywords": [] # 2
},
"arabic_stemmer": {
"type": "stemmer",
"language": "arabic"
}
},
"analyzer": {
"arabic": {
"tokenizer": "standard",
"filter": [
"lowercase",
"arabic_stop",
"arabic_normalization",
"arabic_keywords",
"arabic_stemmer"
]
}
}
}
}
}
可以使用无效词或stopwords_path参数覆盖默认的停用词。
应该删除此过滤器,除非有字词应该排除在干扰之外。
armenian 分析器
分析器可以如以下定制分析仪重新实现:
{
"settings": {
"analysis": {
"filter": {
"armenian_stop": {
"type": "stop",
"stopwords": "_armenian_"
},
"armenian_keywords": {
"type": "keyword_marker",
"keywords": []
},
"armenian_stemmer": {
"type": "stemmer",
"language": "armenian"
}
},
"analyzer": {
"armenian": {
"tokenizer": "standard",
"filter": [
"lowercase",
"armenian_stop",
"armenian_keywords",
"armenian_stemmer"
]
}
}
}
}
}