twright8
(Twright8)
August 24, 2020, 3:25pm
1
My script:
if (doc['companiesHouse.date_of_creation'].size()>0 && doc['awards.date'].size() > 0) { return ((doc['awards.date'].value.getMillis() - doc['companiesHouse.date_of_creation'].value.getMillis()) / 86400000); } return "";
both existing fields are mapped as dates.
Any advice would be appreciated!
Thanks,
Tom
mattkime
(Matthew Kime)
August 25, 2020, 6:39pm
2
Hello @twright8
Which version of the elastic stack are you using? Have you tried using the painless lab? https://www.elastic.co/guide/en/kibana/current/painlesslab.html
twright8
(Twright8)
August 26, 2020, 2:04pm
3
7.9! I dont really know how to use painless lab. is it worth learning then?
mattkime
(Matthew Kime)
August 26, 2020, 2:43pm
4
painless lab provides some IDE and debugging functionality which can be very useful when troubleshooting painless scripts.
system
(system)
Closed
September 23, 2020, 2:43pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.