ไม่สามารถสร้างกำหนดเอง analyzer elaticsearch

0

คำถาม

ฉันกำลังพยายามสร้างกำหนดเอง analyzer ใน elasticsearch. นี่คือ analyzer

{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer" : "standard",
          "filter" : ["custom_stopper", "custom_stems", "custom_synonyms"]
        },
        "filter" : {
            "custom_stopper" : {
                "type" : "stop",
                "stopwords_path" : "analyze/stopwords.txt"
            },
            "custom_stems" : {
                "type" : "stemmer_override",
                "rules_path" : "analyze/stem.txt"
            },
            "custom_synonyms" : {
                "type" : "synonyms",
                "synonyms_path" : "analyze/synonym.txt"

            }
        }
        }
      }
    }
  }

แต่มันโยเกิดข้อผิดพลาด

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "analyzer [filter] must specify either an analyzer type, or a tokenizer"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "analyzer [filter] must specify either an analyzer type, or a tokenizer"
    },
    "status": 400
}

สิ่งที่ฉันกำลังทำอะไรผิดอยู่ที่นี่?

elasticsearch kibana
2021-11-23 13:06:23
1

คำตอบที่ดีที่สุด

1

คน filter ต้องเป็นคนเดียวกันกับระดับ analyzer.

ของโครงสร้างนั่งดูบางอย่างนี้:

{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "standard",
          "char_filter": [
            "custom_stopper",
            "custom_stems",
            "custom_synonyms"
          ]
        }
      },
      "filter": {
        "custom_stopper": {
          "type": "stop",
          "stopwords_path": "analyze/stopwords.txt"
        },
        "custom_stems": {
          "type": "stemmer_override",
          "rules_path": "analyze/stem.txt"
        },
        "custom_synonyms": {
          "type": "synonyms",
          "synonyms_path": "analyze/synonym.txt"
        }
      }
    }
  }
}
2021-11-23 13:20:28

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังคำถามอยู่ในนี้หมวดหมู่