Class: JayAPI::Elasticsearch::Indexes
- Inherits:
-
Object
- Object
- JayAPI::Elasticsearch::Indexes
- Includes:
- Indexable
- Defined in:
- lib/jay_api/elasticsearch/indexes.rb
Overview
Represents a group of Elasticsearch indexes. Allows the execution of searches over all of the specified indexes or push data to all of them at the same time.
Constant Summary
Constants included from Indexable
JayAPI::Elasticsearch::Indexable::DEFAULT_DOC_TYPE, JayAPI::Elasticsearch::Indexable::SUPPORTED_TYPES
Instance Attribute Summary collapse
-
#index_names ⇒ Object
readonly
Returns the value of attribute index_names.
Attributes included from Indexable
Instance Method Summary collapse
-
#initialize(client:, index_names:, batch_size: 100, logger: nil) ⇒ Indexes
constructor
A new instance of Indexes.
Methods included from Indexable
#delete_by_query, #delete_by_query_async, #flush, #index, #push, #queue_size, #search
Constructor Details
#initialize(client:, index_names:, batch_size: 100, logger: nil) ⇒ Indexes
Returns a new instance of Indexes.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jay_api/elasticsearch/indexes.rb', line 20 def initialize(client:, index_names:, batch_size: 100, logger: nil) super return if (batch_size % index_names.size).zero? self.logger.warn( "'batch_size' is not a multiple of the number of elements in 'index_names'. " \ "This can lead to a _bulk size slightly bigger than 'batch_size'" ) end |
Instance Attribute Details
#index_names ⇒ Object (readonly)
Returns the value of attribute index_names.
31 32 33 |
# File 'lib/jay_api/elasticsearch/indexes.rb', line 31 def index_names @index_names end |