modelsext

package
v1.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package modelsext provides extension methods to the structures in the models package. As this package is generated, we cannot put any functionality or helper methods straight into it.

As the models package is used very widely throughout the repository, extensions package should not import anything outside the models package as well to avoid any circular dependencies.

To keep things tidy, use these conventions: 1. Helpers for the struct in models/X.go should be in modelsext/X.go . 2. Functions should be named <struct name><aspirational method name>.

Index

Constants

View Source
const DefaultNamedVectorName = "default"

DefaultNamedVectorName is a default vector named used to create a named vector or to allow access to legacy vector through named vector API.

View Source
const VectorIndexTypeNone = "none"

VectorIndexTypeNone is the VectorIndexType value used to mark a named vector whose search index has been dropped but whose vector data still exists in the objects bucket. This is mirrored from entities/vectorindex to avoid an import cycle.

Variables

This section is empty.

Functions

func ClassGetVectorConfig

func ClassGetVectorConfig(class *models.Class, targetVector string) (models.VectorConfig, bool)

ClassGetVectorConfig returns the vector config for a given class and target vector. There is a special case for the default vector name, which is used to access the legacy vector.

func ClassHasLegacyVectorIndex

func ClassHasLegacyVectorIndex(class *models.Class) bool

ClassHasLegacyVectorIndex checks whether there is a legacy index configured on a class.

func ClassUsesVectorisation added in v1.36.0

func ClassUsesVectorisation(class *models.Class) bool

func IsVectorIndexDropped added in v1.37.0

func IsVectorIndexDropped(cfg models.VectorConfig) bool

IsVectorIndexDropped returns true if the named vector config entry represents a dropped index — i.e. the vector data still exists in the objects bucket but the search index has been removed from disk.

func IsVectorlessUpdate added in v1.39.0

func IsVectorlessUpdate(prev, next *models.Class) bool

IsVectorlessUpdate reports whether a class update keeps (or lands) a class in the vector-less state: the stored class has no legacy vectorizer and no live named vectors (either every entry dropped — the flip moment when the last drop finalizes — or already none), and the update carries no entries. Vector-less classes keep their legacy fields genuinely EMPTY: the update body arrives with server defaults filled in (setClassDefaults cannot know better), and both the update validator and the RAFT-apply FSM use this predicate to ignore those — immutability is relaxed for the comparison, and the FSM never copies legacy fields, so nothing synthetic is ever stored. Only named-vector classes can reach Vectorizer == "", so a legacy class never matches.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL