版本: 8.4-8.9
简要来说,当您尝试在Elasticsearch设置中同时设置[mode]和[enabled]参数时,就会出现此错误。这两个参数是互斥的,意味着您一次只能使用其中一个。要解决此问题,您应该在设置中只使用[mode]或[enabled]参数中的一个,而不能同时使用两者。请检查您的配置,删除或注释掉其中一个参数。然后,重启Elasticsearch以应用更改。
日志上下文 #
日志"Cannot set both [mode] and [enabled] parameters"的类名是 SourceFieldMapper.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:
public SourceFieldMapper build() {
if (enabled.getValue().explicit() && mode.get() != null) {
if (indexMode == IndexMode.TIME_SERIES) {
throw new MapperParsingException("Time series indices only support synthetic source");
} else {
throw new MapperParsingException("Cannot set both [mode] and [enabled] parameters");
}
}
if (isDefault()) {
return indexMode == IndexMode.TIME_SERIES ? TSDB_DEFAULT : DEFAULT;
}





