-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
When the multiline syntax with """
separators is used, the highlighter reports it as an error.
Initially I thought it it's just because of the "
inside, but it's not (just) that. It seems the highlighter is using JSON rules, while painless is more permissive
This makes it very hard for script editing.
"script_fields": {
"flattened_events": {
"script": {
"lang": "painless",
"source": """
Map events = new HashMap();
for (def transaction : doc['external_card_transactions']) {
Map transData = new HashMap();
transData.put("created_at", transaction['created_at'].value);
transData.put("type", transaction['type'].value);
transData.put("amount", transaction['amount'].value);
transData.put("currency_code", transaction['currency_code'].value);
transData.put("original_amount", transaction['currency_conversion.network.original_amount'].value);
transData.put("original_currency_code", transaction['currency_conversion.network.original_currency_code'].value);
transData.put("conversion_rate", transaction['currency_conversion.network.conversion_rate'].value);
events.put(transaction, transData);
}
return events.toString();
"""
}
}
},
cbuescher and jmarcelomb
Metadata
Metadata
Assignees
Labels
No labels