Is it possible to create a long scripted field from a string field?


#1

Hi,

I am using ELK GA 6.3.0. In my index, I have a field called duration. It is mapped as String type. I would like to do some mathematical operations and would like to create a field duration_b having datatype long. Is this possible? How can I do this?

Thanks.


#2

Solved it using;

return Long.parseLong(doc['duration.keyword'].value);

Is this correct procedure?


(Lukas Olson) #3

Yeah, that's exactly how you would want to do it :slight_smile:


(system) #4

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