📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-6.8

简而言之,当 Elasticsearch 尝试自动创建不存在的索引,但自动创建索引设置被禁用或受限时,会出现此错误。该设置可以配置为允许或禁止自动创建索引。要解决此问题,您可以将自动创建索引设置设置为 true 来启用它,或者在索引文档之前手动创建索引。此外,您还可以调整自动创建索引设置以允许特定索引自动创建。

日志上下文 #

日志 “no such index and [” + AUTO_CREATE_INDEX_SETTING.getKey() + “] contains [-” 类名是 AutoCreateIndex.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

boolean include = expression.v2();
 if (Regex.simpleMatch(indexExpression, index)) {
 if (include) {
 return true;
 }
 throw new IndexNotFoundException("no such index and [" + AUTO_CREATE_INDEX_SETTING.getKey() + "] contains [-"
 + indexExpression + "] which forbids automatic creation of the index"; index);
 }
 }
 throw new IndexNotFoundException("no such index and [" + AUTO_CREATE_INDEX_SETTING.getKey() + "] ([" + autoCreate
 + "]) doesn't match"; index);