hnsw

package
v1.29.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Set these defaults if the user leaves them blank
	DefaultCleanupIntervalSeconds = 5 * 60
	DefaultMaxConnections         = 32
	DefaultEFConstruction         = 128
	DefaultEF                     = -1 // indicates "let Weaviate pick"
	DefaultDynamicEFMin           = 100
	DefaultDynamicEFMax           = 500
	DefaultDynamicEFFactor        = 8
	DefaultSkip                   = false
	DefaultFlatSearchCutoff       = 40000

	FilterStrategySweeping = "sweeping"
	FilterStrategyAcorn    = "acorn"

	DefaultFilterStrategy = FilterStrategySweeping

	// Fail validation if those criteria are not met
	MinmumMaxConnections = 4
	MinmumEFConstruction = 4
)
View Source
const (
	DefaultMultivectorEnabled     = false
	DefaultMultivectorAggregation = "maxSim"
)
View Source
const (
	PQEncoderTypeKMeans            = "kmeans"
	PQEncoderTypeTile              = "tile"
	PQEncoderDistributionLogNormal = "log-normal"
	PQEncoderDistributionNormal    = "normal"
)
View Source
const (
	DefaultPQEnabled             = false
	DefaultPQBitCompression      = false
	DefaultPQSegments            = 0
	DefaultPQEncoderType         = PQEncoderTypeKMeans
	DefaultPQEncoderDistribution = PQEncoderDistributionLogNormal
	DefaultPQCentroids           = 256
	DefaultPQTrainingLimit       = 100000
)
View Source
const (
	DefaultSQEnabled       = false
	DefaultSQTrainingLimit = 100000
	DefaultSQRescoreLimit  = 20
)
View Source
const (
	DefaultBQEnabled = false
)
View Source
const (
	MultivectorAggregationMaxSim = "maxSim"
)

Variables

This section is empty.

Functions

func ParseAndValidateConfig added in v1.17.5

func ParseAndValidateConfig(input interface{}, isMultiVector bool) (config.VectorIndexConfig, error)

ParseAndValidateConfig from an unknown input value, as this is not further specified in the API to allow of exchanging the index type

func ValidateMultivectorConfig added in v1.29.0

func ValidateMultivectorConfig(cfg MultivectorConfig) error

func ValidatePQConfig added in v1.20.0

func ValidatePQConfig(cfg PQConfig) error

Types

type BQConfig added in v1.24.0

type BQConfig struct {
	Enabled bool `json:"enabled"`
}

type MultiVectorConfig added in v1.29.0

type MultiVectorConfig struct {
	Enabled    bool   `json:"enabled"`
	Aggregator string `json:"aggregator"`
}

type MultivectorConfig added in v1.29.0

type MultivectorConfig struct {
	Enabled     bool   `json:"enabled"`
	Aggregation string `json:"aggregation"`
}

Multivector configuration

type PQConfig added in v1.18.0

type PQConfig struct {
	Enabled        bool      `json:"enabled"`
	BitCompression bool      `json:"bitCompression"`
	Segments       int       `json:"segments"`
	Centroids      int       `json:"centroids"`
	TrainingLimit  int       `json:"trainingLimit"`
	Encoder        PQEncoder `json:"encoder"`
}

Product Quantization configuration

type PQEncoder added in v1.18.0

type PQEncoder struct {
	Type         string `json:"type"`
	Distribution string `json:"distribution,omitempty"`
}

Product Quantization encoder configuration

type SQConfig added in v1.26.0

type SQConfig struct {
	Enabled       bool `json:"enabled"`
	TrainingLimit int  `json:"trainingLimit"`
	RescoreLimit  int  `json:"rescoreLimit"`
}

type UserConfig

type UserConfig struct {
	Skip                   bool              `json:"skip"`
	CleanupIntervalSeconds int               `json:"cleanupIntervalSeconds"`
	MaxConnections         int               `json:"maxConnections"`
	EFConstruction         int               `json:"efConstruction"`
	EF                     int               `json:"ef"`
	DynamicEFMin           int               `json:"dynamicEfMin"`
	DynamicEFMax           int               `json:"dynamicEfMax"`
	DynamicEFFactor        int               `json:"dynamicEfFactor"`
	VectorCacheMaxObjects  int               `json:"vectorCacheMaxObjects"`
	FlatSearchCutoff       int               `json:"flatSearchCutoff"`
	Distance               string            `json:"distance"`
	PQ                     PQConfig          `json:"pq"`
	BQ                     BQConfig          `json:"bq"`
	SQ                     SQConfig          `json:"sq"`
	FilterStrategy         string            `json:"filterStrategy"`
	Multivector            MultivectorConfig `json:"multivector"`
}

UserConfig bundles all values settable by a user in the per-class settings

func NewDefaultMultiVectorUserConfig added in v1.29.0

func NewDefaultMultiVectorUserConfig() UserConfig

func NewDefaultUserConfig

func NewDefaultUserConfig() UserConfig

func (UserConfig) DistanceName added in v1.23.0

func (u UserConfig) DistanceName() string

func (UserConfig) IndexType

func (u UserConfig) IndexType() string

IndexType returns the type of the underlying vector index, thus making sure the schema.VectorIndexConfig interface is implemented

func (UserConfig) IsMultiVector added in v1.29.0

func (u UserConfig) IsMultiVector() bool

func (*UserConfig) SetDefaults

func (u *UserConfig) SetDefaults()

SetDefaults in the user-specifyable part of the config

Jump to

Keyboard shortcuts

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