Class: ElasticGraph::SchemaDefinition::Indexing::FieldReference Private

Inherits:
Data
  • Object
show all
Defined in:
elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_reference.rb,
elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_reference.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.

A lazy reference to a Field. It contains all attributes needed to build a Field, but the referenced type may not be resolvable yet (which is why this exists).

Instance Method Summary collapse

Instance Method Details

#resolveField?

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 the ElasticGraph::SchemaDefinition::Indexing::Field this reference resolves to (if it can be resolved).

Returns:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 30

def resolve
  return nil unless (resolved_type = type.fully_unwrapped.resolved)

  Indexing::Field.new(
    name: name,
    name_in_index: name_in_index,
    type: type,
    json_schema_layers: type.json_schema_layers,
    indexing_field_type: resolved_type.to_indexing_field_type,
    accuracy_confidence: accuracy_confidence,
    json_schema_customizations: json_schema_options,
    mapping_customizations: mapping_options,
    source: source,
    runtime_field_script: runtime_field_script
  )
end