String parts = "123"
parts.matches("[0-9]+") ?Integer.parseInt(parts): parts
I am using above script to create a scripted field
if a string contains integer : convert it to int and return
else return as it is
But i am getting errors and scripted field is not getting created.
Can someone point out error. I am very new to ES and painless script
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.