Cast Long to String


(Cyril Auburtin) #1

I'm getting errors "cannot convert MethodHandle(Longs)long to (Object)String"

with this scripts:

doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + (String)doc['res.status'].value
String s = (String)doc['res.status'].value;
return doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + s
String s = doc['res.status'].value;
return doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + s

req.method and req.path are Strings, res.status is a Long


note:

doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + doc['res.status'].value

just silently fails and returns empty value


Scripted field conditionals failing (5 of 15 shards failed)
(Cyril Auburtin) #2

apparently naming my scripted field with a starting _ was the issue


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.