Can someone help me out? I am trying to convert a field I have from a string to an int when a condition is met.
This is what I have so far:
if (doc['burn.keyword'].value == "Yes") {
return 1
}elseif (doc['burn.keyword'].value == "No") {
return -1
}
cjcenizal
(CJ Cenizal)
August 13, 2018, 11:36pm
2
Hi Matt,
I'm able to create a script like this:
if (doc['geo.src'].value == "US") {
return 1
}
if (doc['geo.src'].value == "CN") {
return -1
}
return 0
The script is of type "number" and a format of "default".
It looks like it returns the correct values. Can you give this a shot and if it doesn't work, can you tell me what error you're seeing?
Thanks,
CJ
system
(system)
Closed
September 11, 2018, 3:24pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.