Skip to content

Instantly share code, notes, and snippets.

View jacoor's full-sized avatar
💭
Building Community: https://pymasters.pl

Jacek Ostański jacoor

💭
Building Community: https://pymasters.pl
View GitHub Profile
@jclosure
jclosure / contains_key_or_empty.txt
Created July 3, 2017 05:33
Kibana Painless scripted field checks if field exists or is empty and returns default, otherwise value
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value }