Module: ElasticGraph::SchemaArtifacts::ArtifactsHelperMethods
- Included in:
- FromDisk, ElasticGraph::SchemaDefinition::Results
- Defined in:
- elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/artifacts_helper_methods.rb
Overview
Mixin that offers convenient helper methods on top of the basic schema artifacts. Intended to be mixed into FromDisk and other implementations of the same interface (such as ElasticGraph::SchemaDefinition::Results.
Instance Method Summary collapse
-
#datastore_scripts ⇒ Hash<String, Hash<String, Object>>
Provides accesses to the datastore scripts, typically written using the painless scripting language.
-
#index_mappings_by_index_def_name ⇒ Hash<String, Hash<String, Object>>
Provides access to the mappings of both the #index_templates and #indices.
-
#index_templates ⇒ Hash<String, Hash<String, Object>>
Provides accesses to the datastore index templates, which are used for a rollover index defined using ElasticGraph::SchemaDefinition::Indexing::Index#rollover.
-
#indices ⇒ Hash<String, Hash<String, Object>>
Provides accesses to the datastore indices, used for an index that does not rollover.
Instance Method Details
#datastore_scripts ⇒ Hash<String, Hash<String, Object>>
Provides accesses to the datastore scripts, typically written using the painless scripting language.
19 20 21 |
# File 'elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/artifacts_helper_methods.rb', line 19 def datastore_scripts datastore_config.fetch("scripts") end |
#index_mappings_by_index_def_name ⇒ Hash<String, Hash<String, Object>>
Provides access to the mappings of both the #index_templates and #indices.
42 43 44 45 46 |
# File 'elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/artifacts_helper_methods.rb', line 42 def index_mappings_by_index_def_name @index_mappings_by_index_def_name ||= index_templates .transform_values { |config| config.fetch("template").fetch("mappings") } .merge(indices.transform_values { |config| config.fetch("mappings") }) end |
#index_templates ⇒ Hash<String, Hash<String, Object>>
Provides accesses to the datastore index templates, which are used for a rollover index defined using ElasticGraph::SchemaDefinition::Indexing::Index#rollover.
27 28 29 |
# File 'elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/artifacts_helper_methods.rb', line 27 def index_templates datastore_config.fetch("index_templates") end |
#indices ⇒ Hash<String, Hash<String, Object>>
Provides accesses to the datastore indices, used for an index that does not rollover.
34 35 36 |
# File 'elasticgraph-schema_artifacts/lib/elastic_graph/schema_artifacts/artifacts_helper_methods.rb', line 34 def indices datastore_config.fetch("indices") end |