Hey all,
I want to compare a string and an number (integer) inside a scripted field. I know I have to convert the field from string to integer. I just dont know the syntax for that and dont find any result.
The characters of String Field are all numbers so it should work if I get the syntax correct.
my current code:
{
"convert": {
"field" : "StringField",
"type": "integer"
}
}
I created a scripted field of type: number and in the script I used a text field response.raw (which are http response code numbers but stored as text). And used Integer.parseInt on the doc value of it. When I go to Discover I see the numeric result for this scripted field. Does that help?
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.