Briefly, this error occurs when the maxspan value in an Elasticsearch query is set to a non-positive value. Maxspan is used to limit the duration of matches in span queries. It must be a positive value, representing the maximum duration in milliseconds. To resolve this issue, ensure that the maxspan value is set to a positive number. If the value is being dynamically generated, add checks to ensure it’s always positive. If the error persists, check for any possible bugs in the code that may be causing the incorrect value.
This guide will help you check for common problems that cause the log ” A positive maxspan value is required; found [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: parser, plugin.
Log Context
Log “A positive maxspan value is required; found [{}]” class name is LogicalPlanBuilder.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
if (numberCtx instanceof IntegerLiteralContext) { Number number = (Number) visitIntegerLiteral((IntegerLiteralContext) numberCtx).fold(); long value = number.longValue(); if (value <= 0) { throw new ParsingException(source(numberCtx); "A positive maxspan value is required; found [{}]"; value); } String timeString = text(ctx.timeUnit().IDENTIFIER()); if (timeString == null) {