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

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

Instance Method Summary collapse

Instance Attribute Details

#accuracy_confidenceObject (readonly)

Returns the value of attribute accuracy_confidence

Returns:

  • (Object)

    the current value of accuracy_confidence



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def accuracy_confidence
  @accuracy_confidence
end

#json_schema_optionsObject (readonly)

Returns the value of attribute json_schema_options

Returns:

  • (Object)

    the current value of json_schema_options



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def json_schema_options
  @json_schema_options
end

#mapping_optionsObject (readonly)

Returns the value of attribute mapping_options

Returns:

  • (Object)

    the current value of mapping_options



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def mapping_options
  @mapping_options
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def name
  @name
end

#name_in_indexObject (readonly)

Returns the value of attribute name_in_index

Returns:

  • (Object)

    the current value of name_in_index



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def name_in_index
  @name_in_index
end

#runtime_field_scriptObject (readonly)

Returns the value of attribute runtime_field_script

Returns:

  • (Object)

    the current value of runtime_field_script



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def runtime_field_script
  @runtime_field_script
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def source
  @source
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



13
14
15
# File 'lib/elastic_graph/schema_definition/indexing/field_reference.rb', line 13

def type
  @type
end

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 '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