WeaviateEx.Property (WeaviateEx v0.7.4)
View SourceProperty builder for collection schemas.
Provides a fluent API for defining collection properties with proper data types, indexing options, and nested object support.
Examples
# Simple properties
properties = [
Property.text("title"),
Property.text("content", tokenization: :word),
Property.int("views"),
Property.boolean("published"),
Property.date("created_at")
]
# Nested object
author = Property.object("author", [
Property.text("name"),
Property.text("email"),
Property.object("address", [
Property.text("city"),
Property.text("country")
])
])
# Cross-reference
ref = Property.reference("hasAuthor", "Author")
Summary
Functions
Create a blob property.
Create a boolean property
Create a boolean array property
Create a date property
Create a date array property
Create a geo coordinates property
Create an integer property
Create an integer array property
Create a multi-target cross-reference property.
Create a new property definition.
Create a number (float) property
Create a number array property
Create a nested object property.
Create a nested object array property.
Create a phone number property
Create a cross-reference property.
Create a text property
Create a text array property
Create a UUID property
Create a UUID array property
Types
Functions
Create a blob property.
Blobs are not filterable by default.
Create a boolean property
Create a boolean array property
Create a date property
Create a date array property
Create a geo coordinates property
Create an integer property
Create an integer array property
Create a multi-target cross-reference property.
Alias for reference/3 with a list of target collections.
Examples
Property.multi_reference("hasContent", ["Article", "BlogPost", "Video"])
Create a new property definition.
Options
:description- Property description:index_filterable- Enable filtering on this property:index_searchable- Enable full-text search:index_inverted- Include in inverted index:index_range_filters- Enable range filter indexing:tokenization- Tokenization strategy (:word, :whitespace, :field, etc.):skip_vectorization- Don't include in vectorization:vectorize_property_name- Include property name in vector:nested_properties- For object/object[] types
Examples
Property.new("title", :text)
Property.new("title", :text, tokenization: :word, index_searchable: true)
Create a number (float) property
Create a number array property
Create a nested object property.
Examples
Property.object("author", [
Property.text("name"),
Property.text("email"),
Property.object("address", [
Property.text("city"),
Property.text("country")
])
])
Create a nested object array property.
Examples
Property.object_array("authors", [
Property.text("name"),
Property.text("email")
])
Create a phone number property
Create a cross-reference property.
Supports both single-target and multi-target references.
Examples
# Single target reference
Property.reference("hasAuthor", "Author")
Property.reference("hasCategories", "Category", description: "Article categories")
# Multi-target reference (can point to any of the listed collections)
Property.reference("hasContent", ["Article", "BlogPost", "Video"])
Create a text property
Create a text array property
Create a UUID property
Create a UUID array property