Skip to content

Instantly share code, notes, and snippets.

@shawnjohnson
Created December 19, 2016 19:46
Show Gist options
  • Save shawnjohnson/cdaa1290f744c4b55ff5cc4ef33da16d to your computer and use it in GitHub Desktop.
Save shawnjohnson/cdaa1290f744c4b55ff5cc4ef33da16d to your computer and use it in GitHub Desktop.
Refactor return to allow for logging of complete query
private SearchResponse doSearch(SearchRequestBuilder searchRequest, SearchQuery searchQuery) {
...
if(searchQuery.getQuery() != null) {
searchRequest.setQuery(searchQuery.getQuery());
}
// Print full query before sending
if(logger.isDebugEnabled()) {
logger.debug("doSearch searchRequest:\n"+ searchRequest.toString());
}
return getSearchResponse(searchRequest.execute());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment