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

版本: 7.9-7.1

简而言之,当 Elasticsearch 中的字段设置为"index = false"时,会发生此错误。这意味着该字段不可搜索且不能在查询中使用。要解决此问题,您可以将字段的映射更改为"index = true",这将使其可搜索。或者,如果该字段不需要用于搜索,您可以从查询中删除它。另一个解决方案是在查询中使用"_source"字段,无论其"index"设置如何,它都包含所有字段。

日志上下文 #

日志"The field [" + name + “] cannot have index = false"的类名是 WildcardFieldMapper.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考:

}  @Override
 public Builder index(boolean index) {
 if (index == false) {
 throw new MapperParsingException("The field [" + name + "] cannot have index = false");
 }
 return this;
 }  public Builder nullValue(String nullValue) {