Class: ElasticGraph::SchemaDefinition::Indexing::DerivedFields::AppendOnlySet Private
- Inherits:
-
Object
- Object
- ElasticGraph::SchemaDefinition::Indexing::DerivedFields::AppendOnlySet
- Defined in:
- elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/derived_fields/append_only_set.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Responsible for providing bits of the painless script specific to a ElasticGraph::SchemaDefinition::Indexing::DerivedIndexedType#append_only_set field.
Instance Method Summary collapse
-
#apply_operation_returning_update_status ⇒ String
private
A line of painless code to append a value to the set and return a boolean indicating if the set was updated.
-
#function_definitions ⇒ Array<String>
private
Painless functions required by
append_only_set
. -
#setup_statements ⇒ Array<String>
private
The statements here initialize the field to an empty list if it is null.
Instance Method Details
#apply_operation_returning_update_status ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a line of painless code to append a value to the set and return a boolean indicating if the set was updated.
28 29 30 |
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/derived_fields/append_only_set.rb', line 28 def apply_operation_returning_update_status %{appendOnlySet_idempotentlyInsertValues(data["#{source_field}"], ctx._source.#{destination_field})} end |
#function_definitions ⇒ Array<String>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns painless functions required by append_only_set
.
23 24 25 |
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/derived_fields/append_only_set.rb', line 23 def function_definitions [IDEMPOTENTLY_INSERT_VALUES, IDEMPOTENTLY_INSERT_VALUE] end |
#setup_statements ⇒ Array<String>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The statements here initialize the field to an empty list if it is null. This primarily happens when the document does not already exist, but can also happen when we add a new derived field to an existing type.
36 37 38 |
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/derived_fields/append_only_set.rb', line 36 def setup_statements FieldInitializerSupport.build_empty_value_initializers(destination_field, leaf_value: FieldInitializerSupport::EMPTY_PAINLESS_LIST) end |