Skip to content

Instantly share code, notes, and snippets.

@LuxXx
Created March 3, 2021 18:28
Show Gist options
  • Save LuxXx/0ffab10266372f6bd20ccb1ee93479e8 to your computer and use it in GitHub Desktop.
Save LuxXx/0ffab10266372f6bd20ccb1ee93479e8 to your computer and use it in GitHub Desktop.
ElasticSearch to Meldung map
#set($inputRoot = $input.path('$'))
[
#foreach($elem in $inputRoot.hits.hits)
{
"titel": "$util.escapeJavaScript($elem.get("_source").titel).replaceAll("\\'","'")",
"vorname": "$util.escapeJavaScript($elem.get("_source").vorname).replaceAll("\\'","'")",
"nachname": "$util.escapeJavaScript($elem.get("_source").nachname).replaceAll("\\'","'")",
"name": "$util.escapeJavaScript($elem.get("_source").name).replaceAll("\\'","'")",
"position": "$util.escapeJavaScript($elem.get("_source").position).replaceAll("\\'","'")",
"is_company": $util.escapeJavaScript($elem.get("_source").is_company).replaceAll("\\'","'"),
"lei": "$util.escapeJavaScript($elem.get("_source").lei).replaceAll("\\'","'")",
"isin": "$util.escapeJavaScript($elem.get("_source").isin).replaceAll("\\'","'")",
"strasse": "$util.escapeJavaScript($elem.get("_source").strasse).replaceAll("\\'","'")",
"plz": "$util.escapeJavaScript($elem.get("_source").plz).replaceAll("\\'","'")",
"stadt": "$util.escapeJavaScript($elem.get("_source").stadt).replaceAll("\\'","'")",
"land": "$util.escapeJavaScript($elem.get("_source").land).replaceAll("\\'","'")",
"art_des_instruments": "$util.escapeJavaScript($elem.get("_source").art_des_instruments).replaceAll("\\'","'")",
"art_des_geschaefts": "$util.escapeJavaScript($elem.get("_source").art_des_geschaefts).replaceAll("\\'","'")",
"ort_des_geschaefts": "$util.escapeJavaScript($elem.get("_source").ort_des_geschaefts).replaceAll("\\'","'")",
"aggregiertes_volumen": $util.escapeJavaScript($elem.get("_source").aggregiertes_volumen).replaceAll("\\'","'"),
"preis": $util.escapeJavaScript($elem.get("_source").preis).replaceAll("\\'","'"),
"waehrung": "$util.escapeJavaScript($elem.get("_source").waehrung).replaceAll("\\'","'")",
"preis_waehrung": "$util.escapeJavaScript($elem.get("_source").preis_waehrung).replaceAll("\\'","'")",
"datum_des_geschaefts": "$util.escapeJavaScript($elem.get("_source").datum_des_geschaefts).replaceAll("\\'","'")",
"erlaeuterung": "$util.escapeJavaScript($elem.get("_source").erlaeuterung).replaceAll("\\'","'")"
}#if($foreach.hasNext),#end
#end
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment