Hi,
I am trying to create a scripted field(Painless) based on the if condition on the present Field.
The criteria is if a field(suppose "Name") contains "sammy" as a value.
I want to check if the value contains "am" as a substring so it can enter the if condition.
Just like IndexOf, i tried using contains function of java.
I tried to using it, although it does not return any error it still gives empty values.
Eg:-
if(doc['Name'].value.contains("am")){
return "success"
}