Method: Elasticsearch::API::Indices::Actions#get_mapping
- Defined in:
- lib/elasticsearch/api/actions/indices/get_mapping.rb
#get_mapping(arguments = {}) ⇒ Object
Get mapping definitions. For data streams, the API retrieves mappings for the stream’s backing indices.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/elasticsearch/api/actions/indices/get_mapping.rb', line 55 def get_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_mapping' } defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "#{Utils.listify(_index)}/_mapping" else '_mapping' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |