Last active
February 16, 2020 10:58
-
-
Save tobinbc/be2a4f1907b2475c5897c72c1f0edba8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set( $es_items = [] ) | |
#set( $body = $util.parseJson($context.result.body)) | |
#foreach( $entry in $body.hits.hits ) | |
#set ( $item = { | |
"tree": $entry.get("_source"), | |
"distance": $entry.get("sort").get(0) | |
}) | |
$util.qr($es_items.add($item)) | |
#end | |
#set( $es_response = { | |
"items": $es_items | |
} ) | |
$util.toJson($es_response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment