将 ngram 添加到现有索引

Adding ngram to existing index

有没有办法将 ngram 匹配添加到现有索引?我在文档中看到了很多示例如何创建将使用 ngram 进行搜索的索引,但是当我尝试按照这些说明进行操作时,出现错误:

{"error":"IndexAlreadyExistsException[[nameOfIndex] already exists]","status":400}

我正在使用的卷曲示例:

curl -XPUT elasticUrl/nameOfIndex -d '{
   "settings": {
      "number_of_shards": 1
   },
   "mappings": {
      "title": {
         "properties": {
            "text_field": {
               "type": "string",
               "term_vector": "yes"
            }
         }
      }
   }
}'

试试这个:

首先关闭索引,然后应用更新,然后打开索引

POST /blog/_close
// apply index settings updates
POST /blog/_open

来源:link