Class: AWSCDK::OpenSearchServerless::CfnIndex::PropertyMappingProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
open_search_serverless/cfn_index.rb

Overview

Property mappings for the OpenSearch Serverless index.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, dimension: nil, index: nil, method: nil, properties: nil, value: nil) ⇒ PropertyMappingProperty

Returns a new instance of PropertyMappingProperty.

Parameters:

  • type (String)

    The field data type.

  • dimension (Numeric, nil) (defaults to: nil)

    Dimension size for vector fields, defines the number of dimensions in the vector.

  • index (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Whether a field should be indexed.

  • method (AWSCDK::IResolvable, AWSCDK::OpenSearchServerless::CfnIndex::MethodProperty, nil) (defaults to: nil)

    Configuration for k-NN search method.

  • properties (AWSCDK::IResolvable, Hash{String => AWSCDK::IResolvable, AWSCDK::OpenSearchServerless::CfnIndex::PropertyMappingProperty}, nil) (defaults to: nil)

    Defines the fields within the mapping, including their types and configurations.

  • value (String, nil) (defaults to: nil)

    Default value for the field when not specified in a document.



773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'open_search_serverless/cfn_index.rb', line 773

def initialize(type:, dimension: nil, index: nil, method: nil, properties: nil, value: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @dimension = dimension
  Jsii::Type.check_type(@dimension, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "dimension") unless @dimension.nil?
  @index = index
  Jsii::Type.check_type(@index, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "index") unless @index.nil?
  @method = method.is_a?(Hash) ? ::AWSCDK::OpenSearchServerless::CfnIndex::MethodProperty.new(**method.transform_keys(&:to_sym)) : method
  Jsii::Type.check_type(@method, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19vcGVuc2VhcmNoc2VydmVybGVzcy5DZm5JbmRleC5NZXRob2RQcm9wZXJ0eSJ9XX19")), "method") unless @method.nil?
  @properties = properties
  Jsii::Type.check_type(@properties, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfb3BlbnNlYXJjaHNlcnZlcmxlc3MuQ2ZuSW5kZXguUHJvcGVydHlNYXBwaW5nUHJvcGVydHkifV19fSwia2luZCI6Im1hcCJ9fV19fQ==")), "properties") unless @properties.nil?
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") unless @value.nil?
end

Instance Attribute Details

#dimensionNumeric? (readonly)

Dimension size for vector fields, defines the number of dimensions in the vector.



799
800
801
# File 'open_search_serverless/cfn_index.rb', line 799

def dimension
  @dimension
end

#indexBoolean, ... (readonly)

Whether a field should be indexed.



804
805
806
# File 'open_search_serverless/cfn_index.rb', line 804

def index
  @index
end

#methodAWSCDK::IResolvable, ... (readonly)

Configuration for k-NN search method.



809
810
811
# File 'open_search_serverless/cfn_index.rb', line 809

def method
  @method
end

#propertiesAWSCDK::IResolvable, ... (readonly)

Defines the fields within the mapping, including their types and configurations.



814
815
816
# File 'open_search_serverless/cfn_index.rb', line 814

def properties
  @properties
end

#typeString (readonly)

The field data type.

Must be a valid OpenSearch field type.



794
795
796
# File 'open_search_serverless/cfn_index.rb', line 794

def type
  @type
end

#valueString? (readonly)

Default value for the field when not specified in a document.



819
820
821
# File 'open_search_serverless/cfn_index.rb', line 819

def value
  @value
end

Class Method Details

.jsii_propertiesObject



821
822
823
824
825
826
827
828
829
830
# File 'open_search_serverless/cfn_index.rb', line 821

def self.jsii_properties
  {
    :type => "type",
    :dimension => "dimension",
    :index => "index",
    :method => "method",
    :properties => "properties",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



832
833
834
835
836
837
838
839
840
841
842
843
# File 'open_search_serverless/cfn_index.rb', line 832

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "dimension" => @dimension,
    "index" => @index,
    "method" => @method,
    "properties" => @properties,
    "value" => @value,
  })
  result.compact
end