Class: Noiseless::Adapters::OpenSearch

Inherits:
Noiseless::Adapter show all
Includes:
ExecutionModules::OpensearchExecution
Defined in:
lib/noiseless/adapters/open_search.rb

Defined Under Namespace

Classes: PipelinesAPI, RulesAPI

Constant Summary collapse

ClusterAPI =
Adapters::ClusterAPI
IndicesAPI =
Adapters::IndicesAPI

Instance Method Summary collapse

Methods included from ExecutionModules::HttpTransport

#close, #initialize

Methods inherited from Noiseless::Adapter

#async_context?, #bulk, #create_index, #delete_document, #delete_index, #document_exists?, #index_document, #index_exists?, #initialize, #search, #update_document

Methods included from Introspection

#adapter_capabilities, #adapter_info, #build_execution_plan, #compatibility_matrix, #detect_execution_module, #engine_name, #explain_query, #profile_query

Methods included from Instrumentation

#instrument

Instance Method Details

#clusterObject

Cluster health API - needed for Rails healthcheck



28
29
30
# File 'lib/noiseless/adapters/open_search.rb', line 28

def cluster
  @cluster ||= ClusterAPI.new(self)
end

#indicesObject

Indices API - needed for index management operations



33
34
35
# File 'lib/noiseless/adapters/open_search.rb', line 33

def indices
  @indices ||= IndicesAPI.new(self)
end

#pipelinesObject

Search Pipelines API - OpenSearch 3.x feature



38
39
40
# File 'lib/noiseless/adapters/open_search.rb', line 38

def pipelines
  @pipelines ||= PipelinesAPI.new(self)
end

#point_in_time_search(ast_node, pit_id:) ⇒ Object

OpenSearch-specific features



14
15
16
17
18
19
# File 'lib/noiseless/adapters/open_search.rb', line 14

def point_in_time_search(ast_node, pit_id:, **)
  query_hash = ast_to_hash(ast_node)
  Async do
    execute_point_in_time_search(query_hash, pit_id: pit_id, **)
  end
end

#rulesObject

Query Rules API - OpenSearch 3.x feature



43
44
45
# File 'lib/noiseless/adapters/open_search.rb', line 43

def rules
  @rules ||= RulesAPI.new(self)
end

#search_raw(query_body, indexes: []) ⇒ Object

Raw search for CommonShare compatibility



48
49
50
51
52
# File 'lib/noiseless/adapters/open_search.rb', line 48

def search_raw(query_body, indexes: [], **)
  Async do
    execute_search(query_body, indexes: indexes, **)
  end
end

#search_template(template_id:, params: {}) ⇒ Object



21
22
23
24
25
# File 'lib/noiseless/adapters/open_search.rb', line 21

def search_template(template_id:, params: {}, **)
  Async do
    execute_search_template(template_id: template_id, params: params, **)
  end
end