Module: Elasticsearch::API::SearchApplication::Actions

Defined in:
lib/elasticsearch/api/actions/search_application/get.rb,
lib/elasticsearch/api/actions/search_application/put.rb,
lib/elasticsearch/api/actions/search_application/list.rb,
lib/elasticsearch/api/actions/search_application/delete.rb,
lib/elasticsearch/api/actions/search_application/search.rb,
lib/elasticsearch/api/actions/search_application/render_query.rb,
lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb,
lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb,
lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb,
lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb

Instance Method Summary collapse

Instance Method Details

#delete(arguments = {}) ⇒ Object

Delete a search application. Remove a search application and its associated alias. Indices attached to the search application are not removed. This functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the search application to delete. (Required)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/search_application/delete.rb', line 37

def delete(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.delete' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_application/search_application/#{Utils.listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete_behavioral_analytics(arguments = {}) ⇒ Object

Delete a behavioral analytics collection. The associated data stream is also deleted. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the analytics collection to be deleted (Required)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb', line 37

def delete_behavioral_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.delete_behavioral_analytics' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_application/analytics/#{Utils.listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get(arguments = {}) ⇒ Object

Get search application details. This functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the search application (Required)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/elasticsearch/api/actions/search_application/get.rb', line 36

def get(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.get' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_application/search_application/#{Utils.listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_behavioral_analytics(arguments = {}) ⇒ Object

Get behavioral analytics collections. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (Array<String>)

    A list of analytics collections to limit the returned information

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb', line 36

def get_behavioral_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.get_behavioral_analytics' }

  defined_params = [:name].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

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_application/analytics/#{Utils.listify(_name)}"
           else
             '_application/analytics'
           end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#list(arguments = {}) ⇒ Object

Get search applications. Get information about search applications. This functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :q (String)

    Query in the Lucene query string syntax.

  • :from (Integer)

    Starting offset. Server default: 0.

  • :size (Integer)

    Specifies a max number of results to get.

  • :headers (Hash)

    Custom HTTP headers

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/elasticsearch/api/actions/search_application/list.rb', line 39

def list(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.list' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_application/search_application'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#post_behavioral_analytics_event(arguments = {}) ⇒ Object

Create a behavioral analytics collection event. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :collection_name (String)

    The name of the behavioral analytics collection. (Required)

  • :event_type (String)

    The analytics event type. (Required)

  • :debug (Boolean)

    Whether the response type has to include more details

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    payload

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb', line 39

def post_behavioral_analytics_event(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.post_behavioral_analytics_event' }

  defined_params = [:collection_name, :event_type].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?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'collection_name' missing" unless arguments[:collection_name]
  raise ArgumentError, "Required argument 'event_type' missing" unless arguments[:event_type]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _collection_name = arguments.delete(:collection_name)

  _event_type = arguments.delete(:event_type)

  method = Elasticsearch::API::HTTP_POST
  path   = "_application/analytics/#{Utils.listify(_collection_name)}/event/#{Utils.listify(_event_type)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put(arguments = {}) ⇒ Object

Create or update a search application. This functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the search application to be created or updated. (Required)

  • :create (Boolean)

    If true, this request cannot replace or update existing Search Applications.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    search_application

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/search_application/put.rb', line 38

def put(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.put' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_application/search_application/#{Utils.listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_behavioral_analytics(arguments = {}) ⇒ Object

Create a behavioral analytics collection. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the analytics collection to be created or updated. (Required)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb', line 36

def put_behavioral_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.put_behavioral_analytics' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_application/analytics/#{Utils.listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#render_query(arguments = {}) ⇒ Object

Render a search application query. Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified. If a parameter used in the search template is not specified in params, the parameter’s default value will be used. The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API. You must have read privileges on the backing alias of the search application. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the search application to render teh query for. (Required)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

Raises:

  • (ArgumentError)

See Also:



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

def render_query(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.render_query' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_application/search_application/#{Utils.listify(_name)}/_render_query"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#search(arguments = {}) ⇒ Object

Run a search application search. Generate and run an Elasticsearch query that uses the specified query parameteter and the search template associated with the search application or default template. Unspecified template parameters are assigned their default values if applicable. This functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the search application to be searched. (Required)

  • :typed_keys (Boolean)

    Determines whether aggregation names are prefixed by their respective types in the response.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

Raises:

  • (ArgumentError)

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/search_application/search.rb', line 40

def search(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.search' }

  defined_params = [:name].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?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path   = "_application/search_application/#{Utils.listify(_name)}/_search"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end