Module: Elastic

Defined in:
lib/elasticsearch.rb

Constant Summary collapse

ELASTICSEARCH_SERVICE_VERSION =

Constant for elasticsearch-transport meta-header

[:es, client_meta_version].freeze

Class Method Summary collapse

Class Method Details

.client_meta_versionObject

If the version is X.X.X.pre/alpha/beta, use X.X.Xp for the meta-header:



106
107
108
109
110
111
112
# File 'lib/elasticsearch.rb', line 106

def self.client_meta_version
  regexp = /^([0-9]+\.[0-9]+\.[0-9]+)\.?([a-z0-9.-]+)?$/
  match = Elasticsearch::VERSION.match(regexp)
  return "#{match[1]}p" if match[2]

  Elasticsearch::VERSION
end