Method: Elasticsearch::API::Utils#__escape

Defined in:
lib/elasticsearch/api/utils.rb

#__escape(string) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

URL-escape a string

Examples:

__escape('foo/bar') # => 'foo%2Fbar'
__escape('bar^bam') # => 'bar%5Ebam'

31
32
33
34
# File 'lib/elasticsearch/api/utils.rb', line 31

def __escape(string)
  return string if string == '*'
  ERB::Util.url_encode(string.to_s)
end