I'm writing a script for an upsert and i'm having a facing one issue on casting a field.
Basically my field is a String but when myString.isNumber() i would like to cast it Integer with the function Integer.parseInt in order to do a comparison with another field but i'm always receiving the following error :
error":"ElasticsearchIllegalArgumentException[failed to execute script]; nested: GroovyScriptExecutionException[GroovyCastException[Cannot cast object '70' with class 'java.lang.String' to class 'java.lang.Integer']]; ","status":400
Any idea on what can be the issue, here is a part of code :
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.