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

版本: 6.8-7.15

简而言之,当您尝试向 Elasticsearch 中不存在的索引更新或添加映射时,会出现此错误。Elasticsearch 要求在添加映射之前必须先存在索引。要解决此问题,您可以在添加映射之前先创建索引,或者使用索引模板。索引模板会自动将映射应用于匹配模板模式的新索引。此外,您还可以使用"创建索引" API,并在请求中包含映射定义。

日志上下文 #

日志"Attempt to put missing mapping in indices"的类名是 ElasticsearchMappings.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

executeAsyncWithOrigin(client; ML_ORIGIN; PutMappingAction.INSTANCE; putMappingRequest;
ActionListener.wrap(response -> {
    if (response.isAcknowledged()) {
        listener.onResponse(true);
    } else {
        listener.onFailure(new ElasticsearchException("Attempt to put missing mapping in indices "
        + Arrays.toString(indicesThatRequireAnUpdate) + " was not acknowledged"));
    }
 }; listener::onFailure));

} catch (IOException e) {
    listener.onFailure(e);