簡體   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