Skip to content

Instantly share code, notes, and snippets.

@MeiSign
Created October 23, 2013 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MeiSign/d7ab401c717e8b8ef6b9 to your computer and use it in GitHub Desktop.
Save MeiSign/d7ab401c717e8b8ef6b9 to your computer and use it in GitHub Desktop.
EsClient.execute(indexExistsQuery) map { response =>
if (indexExistsQuery.getBooleanResult(indexExistsQuery.getResult(response))) Future.successful(Response)
else EsClient.execute(indexCreationQuery)
} flatMap { _ =>
EsClient.execute(addSuggestionQuery)
} map { response: Response =>
Ok("Feed title: " + (response.json))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment