code: @Deprecated
      public static String encodeUri(String uri) {
          try {
              return URIUtil.encodePathQuery(uri);
          } catch (URIException ex) {
              throw new EsHadoopIllegalArgumentException("Cannot escape uri [" + uri + "]", ex);
          }
      }
docs: Splits the given string on the first '?' then encodes the first half as a path (ignoring slashes and colons)
  and the second half as a query segment (ignoring questionmarks, equals signs, etc...).
  
  @deprecated Prefer to use {@link HttpEncodingTools#encode(String)} instead for encoding specific
  pieces of the URI. This method does not escape certain reserved characters, like '/', ':', '=', and '?'.
  As such, this is not safe to use on URIs that may contain these reserved characters in the wrong places.