Class: ElasticGraph::SchemaDefinition::Indexing::FieldType::Scalar Private

Inherits:
Data
  • Object
show all
Defined in:
elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb,
elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.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 the JSON schema and mapping of a SchemaElements::ScalarType.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scalar_typeSchemaElements::ScalarType (readonly)

Returns the scalar type.

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb', line 24

class Scalar < ::Data
  # @return [Hash<String, ::Object>] the datastore mapping for this scalar type.
  def to_mapping
    Support::HashUtil.stringify_keys(scalar_type.mapping_options)
  end

  # @return [Hash<String, ::Object>] the JSON schema for this scalar type.
  def to_json_schema
    Support::HashUtil.stringify_keys(scalar_type.json_schema_options)
  end

  # @return [Hash<String, ::Object>] additional ElasticGraph metadata to put in the JSON schema for this scalar type.
  def 
    {}
  end

  # @param customizations [Hash<String, ::Object>] JSON schema customizations
  # @return [Hash<String, ::Object>] formatted customizations.
  def format_field_json_schema_customizations(customizations)
    customizations
  end

  # @dynamic initialize, scalar_type
end

Instance Method Details

#format_field_json_schema_customizations(customizations) ⇒ Hash<String, ::Object>

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 formatted customizations.

Parameters:

  • customizations (Hash<String, ::Object>)

    JSON schema customizations

Returns:

  • (Hash<String, ::Object>)

    formatted customizations.



42
43
44
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb', line 42

def format_field_json_schema_customizations(customizations)
  customizations
end

#json_schema_field_metadata_by_field_nameHash<String, ::Object>

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 additional ElasticGraph metadata to put in the JSON schema for this scalar type.

Returns:

  • (Hash<String, ::Object>)

    additional ElasticGraph metadata to put in the JSON schema for this scalar type.



36
37
38
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb', line 36

def 
  {}
end

#to_json_schemaHash<String, ::Object>

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 JSON schema for this scalar type.

Returns:

  • (Hash<String, ::Object>)

    the JSON schema for this scalar type.



31
32
33
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb', line 31

def to_json_schema
  Support::HashUtil.stringify_keys(scalar_type.json_schema_options)
end

#to_mappingHash<String, ::Object>

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 datastore mapping for this scalar type.

Returns:

  • (Hash<String, ::Object>)

    the datastore mapping for this scalar type.



26
27
28
# File 'elasticgraph-schema_definition/lib/elastic_graph/schema_definition/indexing/field_type/scalar.rb', line 26

def to_mapping
  Support::HashUtil.stringify_keys(scalar_type.mapping_options)
end