Invalid number found – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch encounters a number in an unexpected format or place, such as in a field that should contain text or a malformed number in a numeric field. To resolve this, ensure that the data types in your index mapping match the data you’re trying to index. If you’re using dynamic mapping, consider defining explicit mappings for your data. Also, check your data source for any unexpected or malformed numbers.

This guide will help you check for common problems that cause the log ” invalid number found: ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .

Log Context

Log “invalid number found:” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 return Double.NaN;
 } else {
 try {
 return Double.parseDouble(stream.sval);
 } catch (NumberFormatException e) {
 throw new ElasticsearchParseException("invalid number found: " + stream.sval; stream.lineno());
 throw new ElasticsearchParseException("expected number but found: " + tokenString(stream); stream.lineno());


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?