code: public static SearchException getSearchException(final String indexId, final String message,
                                                       final HttpStatusCodeException e) {
          switch (e.getStatusCode()) {
              case SERVICE_UNAVAILABLE:
                  return new SearchServerException(message, e);
              default:
                  return new SearchException(indexId, message, e);
          }
      }
docs: Returns an instance of the appropriate {@link SearchException} depending on the value of the {@link HttpStatus}.
  @param indexId the id of the index
  @param message the message for the exception
  @param e the exception thrown by the http client
  @return the instance of the exception