es 7.x 如何全局设置 custom analyzer ??

2020-08-06 20:10:55 +08:00
 pkwenda
PUT _all
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "ngram_one_word"
        }
      },
      "tokenizer": {
        "ngram_one_word": {
          "type": "ngram",
          "min_gram": 1,
          "max_gram": 16,
          "filter": [ "lowercase" ]
        }
      }
    }
  }
}
{
  "error": {
    "root_cause": [
      {
        "type": "invalid_index_name_exception",
        "reason": "Invalid index name [_all], must not start with '_', '-', or '+'",
        "index_uuid": "_na_",
        "index": "_all"
      }
    ],
    "type": "invalid_index_name_exception",
    "reason": "Invalid index name [_all], must not start with '_', '-', or '+'",
    "index_uuid": "_na_",
    "index": "_all"
  },
  "status": 400
}

不想一个一个设置,求解。

另外问一下能像以前那样 在 elasticsearch.yml 里面全局设置吗 ?

1882 次点击
所在节点    Elasticsearch
2 条回复
misaka19000
2020-08-06 20:57:15 +08:00
index template
pkwenda
2020-08-06 21:01:54 +08:00
@misaka19000 #1 对哈

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/696259

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX