Class: Turbopuffer::Models::AttributeSchemaConfig

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/turbopuffer/models/attribute_schema_config.rb

Defined Under Namespace

Modules: Ann

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(type:, ann: nil, filterable: nil, full_text_search: nil, regex: nil) ⇒ Object

Some parameter documentations has been truncated, see Turbopuffer::Models::AttributeSchemaConfig for more details.

Detailed configuration for an attribute attached to a document.

Parameters:

  • type (String)

    The data type of the attribute. Valid values: string, int, uint, float, uuid, da

  • ann (Boolean, Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig) (defaults to: nil)

    Whether to create an approximate nearest neighbor index for the attribute. Can b

  • filterable (Boolean) (defaults to: nil)

    Whether or not the attributes can be used in filters.

  • full_text_search (Boolean, Turbopuffer::Models::FullTextSearchConfig) (defaults to: nil)

    Whether this attribute can be used as part of a BM25 full-text search. Requires

  • regex (Boolean) (defaults to: nil)

    Whether to enable Regex filters on this attribute.



# File 'lib/turbopuffer/models/attribute_schema_config.rb', line 41


Instance Attribute Details

#annBoolean, ...

Whether to create an approximate nearest neighbor index for the attribute. Can be a boolean or a detailed configuration object.



19
# File 'lib/turbopuffer/models/attribute_schema_config.rb', line 19

optional :ann, union: -> { Turbopuffer::AttributeSchemaConfig::Ann }

#filterableBoolean?

Whether or not the attributes can be used in filters.

Returns:

  • (Boolean, nil)


25
# File 'lib/turbopuffer/models/attribute_schema_config.rb', line 25

optional :filterable, Turbopuffer::Internal::Type::Boolean

#full_text_searchBoolean, ...

Whether this attribute can be used as part of a BM25 full-text search. Requires the ‘string` or `[]string` type, and by default, BM25-enabled attributes are not filterable. You can override this by setting `filterable: true`.



33
# File 'lib/turbopuffer/models/attribute_schema_config.rb', line 33

optional :full_text_search, union: -> { Turbopuffer::FullTextSearch }

#regexBoolean?

Whether to enable Regex filters on this attribute.

Returns:

  • (Boolean, nil)


39
# File 'lib/turbopuffer/models/attribute_schema_config.rb', line 39

optional :regex, Turbopuffer::Internal::Type::Boolean

#typeString

The data type of the attribute. Valid values: string, int, uint, float, uuid, datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool, [DIMS]f16, [DIMS]f32.

Returns:

  • (String)


12
# File 'lib/turbopuffer/models/attribute_schema_config.rb', line 12

required :type, String