Method: OpenSearch::API::Actions#field_caps

Defined in:
lib/opensearch/api/actions/field_caps.rb

#field_caps(arguments = {}) ⇒ Object

Returns the information about the capabilities of fields among multiple indices.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use _all or empty string to perform the operation on all indices

  • :fields (List)

    A comma-separated list of field names

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :include_unmapped (Boolean)

    Indicates whether unmapped fields should be included in the response.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    An index filter specified with the Query DSL



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/opensearch/api/actions/field_caps.rb', line 42

def field_caps(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = if arguments[:body]
             OpenSearch::API::HTTP_POST
           else
             OpenSearch::API::HTTP_GET
           end

  path = if _index
           "#{Utils.__listify(_index)}/_field_caps"
         else
           "_field_caps"
         end
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end