The field name cannot have doc values = false – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.9-7.1

Briefly, this error occurs when a field in Elasticsearch is set with “doc_values” parameter as false. Elasticsearch uses “doc_values” for sorting, aggregating, and in scripts. If set to false, these operations may fail. To resolve this issue, you can either set “doc_values” to true or remove the “doc_values” parameter as it defaults to true. Alternatively, if you don’t need to sort or aggregate on this field, you can ignore this error. However, be aware that this might affect the performance of your queries.

This guide will help you check for common problems that cause the log ” The field [” + name + “] cannot have doc values = false ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “The field [” + name + “] cannot have doc values = false” class name is WildcardFieldMapper.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

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

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?