我正在使用ElasticSearch 5.1,并且想为disabled by default的Stop Token Filter
分析器启用standard
该文档描述了如何在custom
分析器中使用它,但是我想知道如何启用它,因为它已经包含在内。
最佳答案
您必须配置标准分析仪,请参见下面的示例如何使用curl命令(taken from docs here)进行操作:
curl -XPUT 'localhost:9200/my_index?pretty' -d'
{
"settings": {
"analysis": {
"analyzer": {
"std_english": {
"type": "standard",
"stopwords": "_english_"
}
}
}
},
"mappings": {
"my_type": {
"properties": {
"my_text": {
"type": "text",
"analyzer": "standard",
"fields": {
"english": {
"type": "text",
"analyzer": "std_english"
}
}
}
}
}
}
}'
curl -XPOST 'localhost:9200/my_index/_analyze?pretty' -d'
{
"field": "my_text",
"text": "The old brown cow"
}'
curl -XPOST 'localhost:9200/my_index/_analyze?pretty' -d'
{
"field": "my_text.english",
"text": "The old brown cow"
}'
关于elasticsearch - 为标准分析仪启用停止 token 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41587458/