elasticsearch - Elasticsearch索引分析器设置

标签 elasticsearch

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

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

关于elasticsearch - Elasticsearch索引分析器设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44317321/

相关文章:

elasticsearch - 如何存储有关用户已阅读哪些通知的信息?

elasticsearch - 从 ESIntegTestCase 抛出 NullPointerException

elasticsearch - 在具有特定结果集的 Elasticsearch 中按多列进行分组

c# - 如何使用索引列表填充下拉框

mysql - 意外错误 error_class=Errno::EADDRINUSE 错误 ="Address already in use - bind(2) for\"0.0.0.0\"port 24233"

python - elasticsearch python 查询 - 按字段分组然后计数

elasticsearch - Kibana 3 GeoJSON 与 Kibana4 Geohash

hadoop - 如何基于弹性hadoop加入RDD

docker - 熟练使用elasticsearch unreachable_exception

elasticsearch - Elasticsearch-关于文档的nGram,但不包括搜索词