Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIndexValid(dType schemapb.DataType, indexType IndexType, indexParams map[string]string) error
- func CheckIntByRange(params map[string]string, key string, min, max int) bool
- func CheckStrByValues(params map[string]string, key string, container []string) bool
- type IndexChecker
- type IndexCheckerMgr
- type IndexType
Constants ¶
View Source
const ( // L2 represents Euclidean distance L2 = "L2" // IP represents inner product distance IP = "IP" // COSINE represents cosine distance COSINE = "COSINE" // HAMMING represents hamming distance HAMMING = "HAMMING" // JACCARD represents jaccard distance JACCARD = "JACCARD" // TANIMOTO represents tanimoto distance TANIMOTO = "TANIMOTO" // SUBSTRUCTURE represents substructure distance SUBSTRUCTURE = "SUBSTRUCTURE" // SUPERSTRUCTURE represents superstructure distance SUPERSTRUCTURE = "SUPERSTRUCTURE" 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 // DefaultMinDim is the smallest dimension supported in Milvus DefaultMinDim = 1 // DefaultMaxDim is the largest dimension supported in Milvus DefaultMaxDim = 32768 // If Dim = 32 and raw vector data = 2G, query node need 24G disk space When loading the vectors' disk index // If Dim = 2, and raw vector data = 2G, query node need 240G disk space When loading the vectors' disk index // So DiskAnnMinDim should be greater than or equal to 32 to avoid running out of disk space DiskAnnMinDim = 32 HNSWMinEfConstruction = 8 HNSWMaxEfConstruction = 512 HNSWMinM = 4 HNSWMaxM = 64 // 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" )
View Source
const ( FloatVectorDefaultMetricType = IP BinaryVectorDefaultMetricType = JACCARD )
Variables ¶
View Source
var BinIDMapMetrics = []string{HAMMING, JACCARD, TANIMOTO, SUBSTRUCTURE, SUPERSTRUCTURE} // const
BinIDMapMetrics is a set of all metric types supported for binary vector.
View Source
var BinIvfMetrics = []string{HAMMING, JACCARD, TANIMOTO} // const
View Source
var METRICS = []string{L2, IP, COSINE} // const
METRICS is a set of all metrics types supported for float vector.
Functions ¶
func CheckIndexValid ¶
func CheckIndexValid(dType schemapb.DataType, indexType IndexType, indexParams map[string]string) error
TODO: check index parameters according to the index type & data type.
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
Types ¶
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 ( IndexRaftIvfFlat IndexType = "GPU_IVF_FLAT" IndexRaftIvfPQ IndexType = "GPU_IVF_PQ" IndexFaissIDMap IndexType = "FLAT" // no index is built. IndexFaissIvfFlat IndexType = "IVF_FLAT" IndexFaissIvfPQ IndexType = "IVF_PQ" IndexFaissIvfSQ8 IndexType = "IVF_SQ8" IndexFaissBinIDMap IndexType = "BIN_FLAT" IndexFaissBinIvfFlat IndexType = "BIN_IVF_FLAT" IndexHNSW IndexType = "HNSW" IndexDISKANN IndexType = "DISKANN" )
IndexType definitions
Source Files ¶
- base_checker.go
- bin_flat_checker.go
- bin_ivf_flat_checker.go
- binary_vector_base_checker.go
- conf_adapter_mgr.go
- constraints.go
- diskann_checker.go
- flat_checker.go
- float_vector_base_checker.go
- hnsw_checker.go
- index_checker.go
- index_type.go
- ivf_base_checker.go
- ivf_pq_checker.go
- ivf_sq_checker.go
- raft_ivf_pq_checker.go
- scalar_index_checker.go
- utils.go
Click to show internal directories.
Click to hide internal directories.