Class: Noiseless::Adapters::OpenSearch::PipelinesAPI
- Inherits:
-
Object
- Object
- Noiseless::Adapters::OpenSearch::PipelinesAPI
- Defined in:
- lib/noiseless/adapters/open_search.rb
Overview
Search Pipelines API for OpenSearch 3.x Pipelines can include request and response processors for neural search, reranking, etc.
Instance Method Summary collapse
-
#create(name, request_processors: [], response_processors: [], description: nil) ⇒ Object
(also: #put)
Create or update a search pipeline.
-
#delete(name) ⇒ Object
Delete a pipeline.
-
#exists?(name) ⇒ Boolean
Check if a pipeline exists.
-
#get(name) ⇒ Object
Get a specific pipeline.
-
#initialize(adapter) ⇒ PipelinesAPI
constructor
A new instance of PipelinesAPI.
-
#list ⇒ Object
(also: #all)
List all pipelines.
Constructor Details
#initialize(adapter) ⇒ PipelinesAPI
Returns a new instance of PipelinesAPI.
57 58 59 |
# File 'lib/noiseless/adapters/open_search.rb', line 57 def initialize(adapter) @adapter = adapter end |
Instance Method Details
#create(name, request_processors: [], response_processors: [], description: nil) ⇒ Object Also known as: put
Create or update a search pipeline
66 67 68 69 70 71 72 73 |
# File 'lib/noiseless/adapters/open_search.rb', line 66 def create(name, request_processors: [], response_processors: [], description: nil) Sync do @adapter.send(:execute_create_pipeline, name, request_processors: request_processors, response_processors: response_processors, description: description) end end |
#delete(name) ⇒ Object
Delete a pipeline
94 95 96 97 98 |
# File 'lib/noiseless/adapters/open_search.rb', line 94 def delete(name) Sync do @adapter.send(:execute_delete_pipeline, name) end end |
#exists?(name) ⇒ Boolean
Check if a pipeline exists
101 102 103 104 105 |
# File 'lib/noiseless/adapters/open_search.rb', line 101 def exists?(name) Sync do @adapter.send(:execute_pipeline_exists?, name) end end |
#get(name) ⇒ Object
Get a specific pipeline
78 79 80 81 82 |
# File 'lib/noiseless/adapters/open_search.rb', line 78 def get(name) Sync do @adapter.send(:execute_get_pipeline, name) end end |
#list ⇒ Object Also known as: all
List all pipelines
85 86 87 88 89 |
# File 'lib/noiseless/adapters/open_search.rb', line 85 def list Sync do @adapter.send(:execute_list_pipelines) end end |