Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAutoIndexConfig()
- func CheckAutoIndexHelper(key string, m map[string]string, dtype schemapb.DataType)
- func CheckIntByRange(params map[string]string, key string, min, max int) bool
- func CheckStrByValues(params map[string]string, key string, container []string) bool
- func HandleCStatus(status *C.CStatus) error
- func IsDiskIndex(indexType IndexType) bool
- func IsGpuIndex(indexType IndexType) bool
- func IsHYBRIDChecker(checker interface{}) bool
- func IsOffsetCacheSupported(indexType IndexType) bool
- func IsScalarIndexType(indexType IndexType) bool
- func IsScalarMmapIndex(indexType IndexType) bool
- func IsVectorMmapIndex(indexType IndexType) bool
- func ValidateMmapIndexParams(indexType IndexType, indexParams map[string]string) error
- func ValidateOffsetCacheIndexParams(indexType IndexType, indexParams map[string]string) error
- func ValidateParamTable()
- type AUTOINDEXChecker
- func (c *AUTOINDEXChecker) CheckTrain(dataType schemapb.DataType, params map[string]string) error
- func (c *AUTOINDEXChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error
- func (c AUTOINDEXChecker) SetDefaultMetricTypeIfNotExist(dType schemapb.DataType, m map[string]string)
- func (c AUTOINDEXChecker) StaticCheck(dataType schemapb.DataType, params map[string]string) error
- type BITMAPChecker
- type HYBRIDChecker
- type INVERTEDChecker
- type IndexChecker
- type IndexCheckerMgr
- type IndexType
- type STLSORTChecker
- type TRIEChecker
Constants ¶
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 )
Variables ¶
var ( FloatVectorMetrics = []string{metric.L2, metric.IP, metric.COSINE} // const BinaryVectorMetrics = []string{metric.HAMMING, metric.JACCARD, metric.SUBSTRUCTURE, metric.SUPERSTRUCTURE} // const )
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 CheckIntByRange ¶
CheckIntByRange check if the data corresponding to the key is in the range of [min, max]. Return false if:
- the key does not exist, or
- the data cannot be converted to an integer, or
- the number is not in the range [min, max]
Return true otherwise
func CheckStrByValues ¶
CheckStrByValues check whether the data corresponding to the key appears in the string slice of container. Return false if:
- the key does not exist, or
- the data does not appear in the container
Return true otherwise
func HandleCStatus ¶
HandleCStatus deals with the error returned from CGO
func IsDiskIndex ¶
func IsGpuIndex ¶
func IsHYBRIDChecker ¶
func IsHYBRIDChecker(checker interface{}) bool
func IsOffsetCacheSupported ¶
func IsScalarIndexType ¶
func IsScalarMmapIndex ¶
func IsVectorMmapIndex ¶
IsVectorMmapIndex check if the vector index can be mmaped
func ValidateMmapIndexParams ¶
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 (*AUTOINDEXChecker) CheckValidDataType ¶
func (c *AUTOINDEXChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error
func (AUTOINDEXChecker) SetDefaultMetricTypeIfNotExist ¶
type BITMAPChecker ¶
type BITMAPChecker struct {
// contains filtered or unexported fields
}
func (*BITMAPChecker) CheckTrain ¶
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 (*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 (*INVERTEDChecker) CheckValidDataType ¶
func (c *INVERTEDChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error
type IndexChecker ¶
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 (*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 (*TRIEChecker) CheckValidDataType ¶
func (c *TRIEChecker) CheckValidDataType(indexType IndexType, field *schemapb.FieldSchema) error