繁体   English   中英

Elasticsearch索引分析器设置

[英]Elasticsearch index analyzer settings

我是弹性搜索的初学者。 我试图将分析器添加到索引中。 这是代码:

PUT drug_mono6/_settings
{
"analysis": {
"analyzer": {
  "attachment.content": {
    "type": "custom",
    "tokenizer": "Whitespace"
  }
}
}
}

但是,这样做之后,我无法重新打开索引。 我收到的错误是:

{
"error": {
"root_cause": [
{
"type": "exception",
"reason": "Failed to verify index [drug_mono6/SMmaJ4iPTCSUHp-oedsadA]"
}
],
"type": "exception",
"reason": "Failed to verify index [drug_mono6/SMmaJ4iPTCSUHp-oedsadA]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "analyzer [attachment] must specify either an analyzer type, or 
 a tokenizer"
}
},
"status": 500
}`

有没有办法修改设置并删除更改?

这应该工作

PUT drug_mono6
{
    "analysis": {
        "analyzer": {
            "attachment": {
                "type": "custom",
                "tokenizer": "whitespace"
            }
        }
    }
}

https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM