search

package
v1.37.13 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalRef

type LocalRef struct {
	Class  string
	Fields map[string]interface{}
}

LocalRef to be filled by the search backend to indicate that the particular reference field is a local ref and does not require further resolving, as opposed to a NetworkRef.

type Result

type Result struct {
	ID                   strfmt.UUID
	DocID                *uint64
	ClassName            string
	Score                float32
	SecondarySortValue   float32
	ExplainScore         string
	Dist                 float32
	Vector               []float32
	Vectors              models.Vectors
	Beacon               string
	Certainty            float32
	Schema               models.PropertySchema
	Created              int64
	Updated              int64
	AdditionalProperties models.AdditionalProperties
	VectorWeights        map[string]string
	IsConsistent         bool
	Tenant               string

	// Dimensions in case search was vector-based, 0 otherwise
	Dims int
}

Result contains some info of a concept (kind), but not all. For additional info the ID can be used to retrieve the full concept from the connector storage

func (Result) Object

func (r Result) Object() *models.Object

func (Result) ObjectWithVector

func (r Result) ObjectWithVector(includeVector bool) *models.Object

type Results

type Results []Result

func (Results) Objects

func (rs Results) Objects() []*models.Object

func (Results) ObjectsWithVector

func (rs Results) ObjectsWithVector(includeVector bool) []*models.Object

type SelectClass

type SelectClass struct {
	ClassName            string                `json:"className"`
	RefProperties        SelectProperties      `json:"refProperties"`
	AdditionalProperties additional.Properties `json:"additionalProperties"`
}

type SelectProperties

type SelectProperties []SelectProperty

func (SelectProperties) FindProperty

func (sp SelectProperties) FindProperty(propName string) *SelectProperty

FindProperty returns the first property named propName, or nil. The pointer aliases the slice element; treat it as read-only.

Prefer Indexed for repeated lookups on the same instance. The index isn't cached here because SelectProperties is copied by value and mutated after construction (e.g. extractGroupBy), so a cached map could go stale.

func (SelectProperties) GetPropertyNames added in v1.27.0

func (sp SelectProperties) GetPropertyNames() []string

func (SelectProperties) HasProps added in v1.22.0

func (sp SelectProperties) HasProps() bool

func (SelectProperties) HasRefs

func (sp SelectProperties) HasRefs() bool

func (SelectProperties) Indexed added in v1.36.23

Indexed builds a SelectPropertiesIndex over sp, keeping the first occurrence of duplicate names. A nil or empty sp yields a nil index.

func (SelectProperties) ShouldResolve

func (sp SelectProperties) ShouldResolve(path []string) (bool, error)

type SelectPropertiesIndex added in v1.36.23

type SelectPropertiesIndex map[string]*SelectProperty

SelectPropertiesIndex is a name-based lookup index over a SelectProperties slice; build via Indexed and reuse for repeated lookups. It holds pointers into the source slice, so don't mutate the slice while the index is in use; it is otherwise read-only and safe for concurrent readers.

func (SelectPropertiesIndex) Find added in v1.36.23

func (idx SelectPropertiesIndex) Find(propName string) *SelectProperty

Find returns the property named propName, or nil if none matches.

type SelectProperty

type SelectProperty struct {
	Name string `json:"name"`

	IsPrimitive bool `json:"isPrimitive"`

	IsObject bool `json:"isObject"`

	// Include the __typename in all the Refs below.
	IncludeTypeName bool `json:"includeTypeName"`

	// Not a primitive nor nested type? Then select these properties.
	Refs []SelectClass `json:"refs"`

	// Nested type? Then select these properties.
	Props []SelectProperty `json:"objs"`
}

func (SelectProperty) FindSelectClass

func (sp SelectProperty) FindSelectClass(className schema.ClassName) *SelectClass

FindSelectClass by specifying the exact class name. The returned pointer aliases the slice element and must be treated as read-only.

func (SelectProperty) FindSelectProperty added in v1.22.0

func (sp SelectProperty) FindSelectProperty(name string) *SelectProperty

FindSelectProperty by specifying the exact object name. The returned pointer aliases the slice element and must be treated as read-only.

func (SelectProperty) HasPeer

func (sp SelectProperty) HasPeer(peerName string) bool

HasPeer returns true if any of the referenced classes are from the specified peer

Jump to

Keyboard shortcuts

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