I'm trying to create a scripted field in Kibana, which checks whether the field "Direction" is "I" or not.
if (doc['Direction'].value != "I") {return 1;} else {return 0;}
But for some reason, it won't work. With all other fields, that aren't explicitly mentioned in the index mapping it works that way, but I had to mention Direction in the mapping because I also have an alias pointing to it. For Direction I put the following in the mapping file:
"Direction": {
"type": "keyword"
}
And there is also an alias pointing to Direction:
"ISDN_Direction": {
"path": "Direction",
"type": "alias"
}
but both fields can't be used in the painless script. I don't get an error, but the result preview, for the first 10 results, is just empty.
Can someone help me with this issue?