Unsupported zero terms docs value zeroTermsDocs – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-6.8

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when an invalid value is passed to the “zero_terms_docs” parameter in Elasticsearch. This parameter is used in match queries and it determines what to do when no terms are found. The valid values are “none” and “all”. If any other value is passed, this error will occur. To resolve this issue, ensure that the value passed to “zero_terms_docs” is either “none” or “all”. If the parameter is not necessary for your query, consider removing it altogether.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” Unsupported zero_terms_docs value [” + zeroTermsDocs + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, query.

Log Context

Log “Unsupported zero_terms_docs value [” + zeroTermsDocs + “]” class name is MultiMatchQueryBuilder.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if ("none".equalsIgnoreCase(zeroTermsDocs)) {
 zeroTermsQuery = MatchQuery.ZeroTermsQuery.NONE;
 } else if ("all".equalsIgnoreCase(zeroTermsDocs)) {
 zeroTermsQuery = MatchQuery.ZeroTermsQuery.ALL;
 } else {
 throw new ParsingException(parser.getTokenLocation(); "Unsupported zero_terms_docs value [" + zeroTermsDocs + "]");
 }
 } else if (AbstractQueryBuilder.NAME_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
 queryName = parser.text();
 } else if (GENERATE_SYNONYMS_PHRASE_QUERY.match(currentFieldName; parser.getDeprecationHandler())) {
 autoGenerateSynonymsPhraseQuery = parser.booleanValue();

 

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?