@Setting annotation for Elasticsearch is ignored in Spring Boot

后端 未结 1 1738
盖世英雄少女心
盖世英雄少女心 2021-01-18 07:00

In my Spring Boot application I have a @Setting annotation pointing to a settings JSON file but it seems to be completely ignored.

@Setting(settingPath = \"         


        
相关标签:
1条回答
  • 2021-01-18 07:11

    Your elasticsearch-settings.json file is missing the index element. Try like this instead:

    {
      "index": {
        "analysis": {
          "analyzer": {
            "my_ngram_analyzer": {
              "tokenizer": "my_ngram_tokenizer"
            }
          },
          "tokenizer": {
            "my_ngram_tokenizer": {
              "type": "nGram",
              "min_gram": "2",
              "max_gram": "3",
              "token_chars": [
                "letter",
                "digit"
              ]
            }
          }
        }
      }
    }
    
    0 讨论(0)
提交回复
热议问题