I want to combine several fields in Kibana's scripted fields editor using painless. I've got the following, but the field displays in Kibana's Discover interface with the literal \n rather than with a new line:
doc['field1'].value + '\\n' + doc['field2'].value
Secondary question: how do I check if doc['somefield'].value has a value before i include it?