I am try to fill a new field to my old data through re-indexing, but when i run below it's gives me below error. The status field is set to long from mapping. Please help me to resolve this.
The ctx._source value provides access to the actual indexed JSON document. The fact that it may be using a long mapping for field status only means that the value of the status field will be parsed as long while indexing but if that field carries a string then it will still remain as string value in the reindex script.
To fix that try parsing the ctx._source.status with Integer.parseInt static method prior to making the comparison.,
Thank you for your response. I tried to parse int x = Integer.parseInt(ctx._source.status);
But now i'am getting "reason": "Cannot cast java.lang.Integer to java.lang.String"
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.