indexparamcheck

package
v0.10.3-0...-bec5499 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinNBits     = 1
	MaxNBits     = 16
	DefaultNBits = 8

	// MinNList is the lower limit of nlist that used in Index IVFxxx
	MinNList = 1
	// MaxNList is the upper limit of nlist that used in Index IVFxxx
	MaxNList = 65536

	HNSWMinEfConstruction = 1
	HNSWMaxEfConstruction = 2147483647
	HNSWMinM              = 1
	HNSWMaxM              = 2048

	// DIM is a constant used to represent dimension
	DIM = common.DimKey
	// Metric is a constant used to metric type
	Metric = common.MetricTypeKey
	// NLIST is a constant used to nlist in Index IVFxxx
	NLIST = "nlist"
	NBITS = "nbits"
	IVFM  = "m"

	EFConstruction = "efConstruction"
	HNSWM          = "M"

	RaftCacheDatasetOnDevice = "cache_dataset_on_device"

	// Cagra Train Param
	CagraInterDegree = "intermediate_graph_degree"
	CagraGraphDegree = "graph_degree"
	CagraBuildAlgo   = "build_algo"

	CargaBuildAlgoIVFPQ     = "IVF_PQ"
	CargaBuildAlgoNNDESCENT = "NN_DESCENT"

	// Sparse Index Param
	SparseDropRatioBuild = "drop_ratio_build"

	BM25K1 = "bm25_k1"
	BM25B  = "bm25_b"

	MaxBitmapCardinalityLimit = 1000
)
View Source
const (
	FloatVectorDefaultMetricType       = metric.COSINE
	SparseFloatVectorDefaultMetricType = metric.IP
	BinaryVectorDefaultMetricType      = metric.HAMMING
)

Variables

View Source
var (
	FloatVectorMetrics  = []string{metric.L2, metric.IP, metric.COSINE}                                        // const
	BinaryVectorMetrics = []string{metric.HAMMING, metric.JACCARD, metric.SUBSTRUCTURE, metric.SUPERSTRUCTURE} // const
)
View Source
var (
	BinIDMapMetrics     = []string{metric.HAMMING, metric.JACCARD, metric.SUBSTRUCTURE, metric.SUPERSTRUCTURE} // const
	BinIvfMetrics       = []string{metric.HAMMING, metric.JACCARD}                                             // const
	HnswMetrics         = []string{metric.L2, metric.IP, metric.COSINE, metric.HAMMING, metric.JACCARD}        // const
	RaftMetrics         = []string{metric.L2, metric.IP}
	CagraBuildAlgoTypes = []string{CargaBuildAlgoIVFPQ, CargaBuildAlgoNNDESCENT}

	SparseMetrics = []string{metric.IP, metric.BM25} // const
)

BinIDMapMetrics is a set of all metric types supported for binary vector.

Functions

func CheckAutoIndexConfig

func CheckAutoIndexConfig()

func CheckAutoIndexHelper

func CheckAutoIndexHelper(key string, m map[string]string, dtype schemapb.DataType)

func CheckIntByRange

func CheckIntByRange(params map[string]string, key string, min, max int) bool

CheckIntByRange check if the data corresponding to the key is in the range of [min, max]. Return false if:

  1. the key does not exist, or
  2. the data cannot be converted to an integer, or
  3. the number is not in the range [min, max]

Return true otherwise

func CheckStrByValues

func CheckStrByValues(params map[string]string, key string, container []string) bool

CheckStrByValues check whether the data corresponding to the key appears in the string slice of container. Return false if:

  1. the key does not exist, or
  2. the data does not appear in the container

Return true otherwise

func HandleCStatus

func HandleCStatus(status *C.CStatus) error

HandleCStatus deals with the error returned from CGO

func IsDiskIndex

func IsDiskIndex(indexType IndexType) bool

func IsGpuIndex

func IsGpuIndex(indexType IndexType) bool

func IsHYBRIDChecker

func IsHYBRIDChecker(checker interface{}) bool

func IsOffsetCacheSupported

func IsOffsetCacheSupported(indexType IndexType) bool

func IsScalarIndexType

func IsScalarIndexType(indexType IndexType) bool

func IsScalarMmapIndex

func IsScalarMmapIndex(indexType IndexType) bool

func IsVectorMmapIndex

func IsVectorMmapIndex(indexType IndexType) bool

IsVectorMmapIndex check if the vector index can be mmaped

func ValidateMmapIndexParams

func ValidateMmapIndexParams(indexType IndexType, indexParams map[string]string) error

func ValidateOffsetCacheIndexParams

func ValidateOffsetCacheIndexParams(indexType IndexType, indexParams map[string]string) error

func ValidateParamTable

func ValidateParamTable()

Types

type AUTOINDEXChecker

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

AUTOINDEXChecker checks if a TRIE index can be built.

func (*AUTOINDEXChecker) CheckTrain

func (c *AUTOINDEXChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error

func (*AUTOINDEXChecker) CheckValidDataType

func (c *AUTOINDEXChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error

func (AUTOINDEXChecker) SetDefaultMetricTypeIfNotExist

func (c AUTOINDEXChecker) SetDefaultMetricTypeIfNotExist(dType schemapb.DataType, m map[string]string)

func (AUTOINDEXChecker) StaticCheck

func (c AUTOINDEXChecker) StaticCheck(dataType schemapb.DataType, params map[string]string) error

type BITMAPChecker

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

func (*BITMAPChecker) CheckTrain

func (c *BITMAPChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error

func (*BITMAPChecker) CheckValidDataType

func (c *BITMAPChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error

type HYBRIDChecker

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

func (*HYBRIDChecker) CheckTrain

func (c *HYBRIDChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error

func (*HYBRIDChecker) CheckValidDataType

func (c *HYBRIDChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error

type INVERTEDChecker

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

INVERTEDChecker checks if a INVERTED index can be built.

func (*INVERTEDChecker) CheckTrain

func (c *INVERTEDChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error

func (*INVERTEDChecker) CheckValidDataType

func (c *INVERTEDChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error

type IndexChecker

type IndexChecker interface {
	CheckTrain(schemapb.DataType, map[string]string) error
	CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error
	SetDefaultMetricTypeIfNotExist(schemapb.DataType, map[string]string)
	StaticCheck(schemapb.DataType, map[string]string) error
}

type IndexCheckerMgr

type IndexCheckerMgr interface {
	GetChecker(indexType string) (IndexChecker, error)
}

func GetIndexCheckerMgrInstance

func GetIndexCheckerMgrInstance() IndexCheckerMgr

GetIndexCheckerMgrInstance gets the instance of IndexCheckerMgr.

type IndexType

type IndexType = string

IndexType string.

const (
	IndexVector IndexType = "VECINDEX"

	// scalar index
	IndexSTLSORT  IndexType = "STL_SORT"
	IndexTRIE     IndexType = "TRIE"
	IndexTrie     IndexType = "Trie"
	IndexBitmap   IndexType = "BITMAP"
	IndexHybrid   IndexType = "HYBRID" // BITMAP + INVERTED
	IndexINVERTED IndexType = "INVERTED"

	AutoIndex IndexType = "AUTOINDEX"
)

IndexType definitions

type STLSORTChecker

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

STLSORTChecker checks if a STL_SORT index can be built.

func (*STLSORTChecker) CheckTrain

func (c *STLSORTChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error

func (*STLSORTChecker) CheckValidDataType

func (c *STLSORTChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error

type TRIEChecker

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

TRIEChecker checks if a TRIE index can be built.

func (*TRIEChecker) CheckTrain

func (c *TRIEChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error

func (*TRIEChecker) CheckValidDataType

func (c *TRIEChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error

Jump to

Keyboard shortcuts

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