vector

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InternalQuery

type InternalQuery struct {
	Field        string
	Vector       []float32
	Base64Vector string

	NumCandidates *uint32
	Boost         *float32
}

InternalQuery is used for internal functionality. Internal: This should never be used and is not supported.

func (InternalQuery) MarshalJSON

func (q InternalQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal's this query to JSON for the search REST API.

func (InternalQuery) Validate

func (q InternalQuery) Validate() error

Validate verifies that settings in the query are valid.

type InternalSearch

type InternalSearch struct {
	Queries []InternalQuery

	VectorQueryCombination VectorQueryCombination
}

InternalSearch is used for internal functionality. Internal: This should never be used and is not supported.

func (InternalSearch) Validate

func (s InternalSearch) Validate() error

Validate verifies that settings in the search (including all queries) are valid.

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query specifies a vector Query.

func NewBase64Query added in v2.9.0

func NewBase64Query(vectorFieldName string, base64Vector string) *Query

NewBase64Query constructs a new vector Query using a Base64-encoded sequence of little-endian IEEE 754 floats.

func NewQuery

func NewQuery(vectorFieldName string, vector []float32) *Query

NewQuery constructs a new vector Query.

func (*Query) Boost

func (q *Query) Boost(boost float32) *Query

Boost specifies the boost for this query.

func (*Query) Internal

func (q *Query) Internal() InternalQuery

Internal is used for internal functionality. Internal: This should never be used and is not supported.

func (*Query) NumCandidates

func (q *Query) NumCandidates(num uint32) *Query

NumCandidates controls how many results are returned for this query.

type Search struct {
	// contains filtered or unexported fields
}

Search specifies a vector Search.

func NewSearch

func NewSearch(queries []*Query, opts *SearchOptions) *Search

NewSearch constructs a new vector Search.

func (*Search) Internal

func (s *Search) Internal() InternalSearch

Internal is used for internal functionality. Internal: This should never be used and is not supported.

type SearchOptions

type SearchOptions struct {
	VectorQueryCombination VectorQueryCombination
}

SearchOptions specifies the options available to vector Search.

type VectorQueryCombination

type VectorQueryCombination string

VectorQueryCombination specifies how elements in the array are combined.

const (
	VectorQueryCombinationNotSet VectorQueryCombination = ""
	VectorQueryCombinationAnd    VectorQueryCombination = "and"
	VectorQueryCombinationOr     VectorQueryCombination = "or"
)

Jump to

Keyboard shortcuts

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