class SearchIngest::Elastic
- SearchIngest::Elastic
- Reference
- Object
Included Modules
- Habitat::SettingsHelpers
- Habitat::TempConfig
Defined in:
search-ingest/elastic.crConstant Summary
-
HABITAT_SETTINGS =
[{decl: uri : URI | ::Nil = ES_URI, example: nil, validation: nil}, {decl: host : String = ES_HOST, example: nil, validation: nil}, {decl: port : Int32 = ES_PORT, example: nil, validation: nil}, {decl: tls : Bool = ES_TLS, example: nil, validation: nil}, {decl: pool_size : Int32 = ES_CONN_POOL || SearchIngest::MANAGED_TABLES.size, example: nil, validation: nil}, {decl: idle_pool_size : Int32 = ES_IDLE_POOL || (SearchIngest::MANAGED_TABLES.size // 4), example: nil, validation: nil}, {decl: pool_timeout : Float64 = ES_CONN_POOL_TIMEOUT, example: nil, validation: nil}] of Nil
-
Log =
::Log.for(self)
Constructors
Class Method Summary
-
.apply_index_mapping(index, mapping)
Applies a mapping to an index in elasticsearch
-
.bulk=(bulk : Bool)
Whether or not to use the bulk api
-
.bulk? : Bool
Whether or not to use the bulk api
-
.bulk_action(action, document, index, parents = [] of Parent, no_children = true)
Generates the body of a Bulk request for a PostgreSQL record in ES - Creates document in table index - Adds document to all parent table indices, routing by the parent id
-
.bulk_action_header(action : Action, index : String, id : String, routing : String | Nil = nil)
Generates the header for an es action, precedes an optional document
-
.bulk_operation(body)
Make a request to the Elasticsearch bulk API endpoint
-
.bulk_request(action : Action, index : String, id : String, document_type : String, document_any : Hash(String, JSON::Any) | Nil = nil, parent_id : String | Nil = nil, no_children : Bool = true)
Constructs the bulk request for a single ES document
-
.check_index?(index)
Check index present in elasticsearch
-
.client(&)
Yield an acquired client from the pool
- .configure(&)
-
.create_document(index, document, parents = [] of Parent, no_children = true)
Create a new document in ES from a PgORM model
-
.delete_all
Delete all indices
-
.delete_document(index, document, parents = [] of Parent)
Delete a document in ES from a PgORM model
-
.delete_index(index)
Delete an index elasticsearch
-
.delete_indices(indices)
Delete several indices elasticsearch
-
.document_join_field(document_type, parent_id = nil)
Create a join field for a document body Can set just the document type if document is the parent
-
.document_path(index, id, routing = nil)
Constructs the ES path of a document
-
.document_type(document)
Picks off the model type from the class name
-
.empty_indices(indices : Array(String) | Nil = nil)
Remove documents from indices Removes from all indices if no argument given.
-
.get_mapping?(index) : String | Nil
Get the mapping applied to an index
-
.headers
Generate JSON header for ES requests
-
.healthy?
Checks availability of Elasticsearch
- .settings
-
.single_action(action : Action, document, index : String, parents : Array(Parent) = [] of Parent, no_children : Bool = true)
Generates the body of a Bulk request for a PostgreSQL record in ES - Creates document in table index - Adds document to all parent table indices, routing by the parent id
-
.single_delete(index : String, id : String, routing : String | Nil = nil)
Single request delete
- .single_request(action : Action, index : String, id : String, document_type : String, document_any : Hash(String, JSON::Any) | Nil = nil, parent_id : String | Nil = nil, no_children : Bool = true)
-
.single_upsert(index : String, id : String, document, routing : String | Nil = nil)
Single request upsert
-
.skip_replication?(attributes, index : String, parents : Array(Parent))
Skip replication to own index if the document type is self-associated and has a parent
-
.update_body(document)
Embeds document inside doc field.
-
.update_document(index, document, parents = [] of Parent, no_children = true)
Update a document in ES from a PgORM model
Instance Method Summary
Macro Summary
Constructor Detail
Class Method Detail
Generates the body of a Bulk request for a PostgreSQL record in ES
- Creates document in table index
- Adds document to all parent table indices, routing by the parent id
Generates the header for an es action, precedes an optional document
Make a request to the Elasticsearch bulk API endpoint
Throws on failure
Constructs the bulk request for a single ES document
Create a new document in ES from a PgORM model
Delete a document in ES from a PgORM model
Create a join field for a document body Can set just the document type if document is the parent
Remove documents from indices Removes from all indices if no argument given.
Generates the body of a Bulk request for a PostgreSQL record in ES
- Creates document in table index
- Adds document to all parent table indices, routing by the parent id
Single request delete
Single request upsert
Skip replication to own index if the document type is self-associated and has a parent
Update a document in ES from a PgORM model