Skip to content

Commit

Permalink
Add test cases for groupby search
Browse files Browse the repository at this point in the history
Signed-off-by: ThreadDao <[email protected]>
  • Loading branch information
ThreadDao committed Mar 12, 2024
1 parent 1a1a092 commit 3844d10
Show file tree
Hide file tree
Showing 4 changed files with 531 additions and 62 deletions.
45 changes: 28 additions & 17 deletions test/common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,26 +1030,37 @@ func MergeColumnsToDynamic(nb int, columns []entity.Column) *entity.ColumnJSONBy
// --- gen row data ---

// --- index utils ---
var SupportFloatMetricType = []entity.MetricType{
entity.L2,
entity.IP,
entity.COSINE,
}

var SupportBinFlatMetricType = []entity.MetricType{
entity.JACCARD,
entity.HAMMING,
entity.SUBSTRUCTURE,
entity.SUPERSTRUCTURE,
}

var SupportBinIvfFlatMetricType = []entity.MetricType{
entity.JACCARD,
entity.HAMMING,
}

// GenAllFloatIndex gen all float vector index
func GenAllFloatIndex(metricType entity.MetricType) []entity.Index {
func GenAllFloatIndex() []entity.Index {
nlist := 128
idxFlat, _ := entity.NewIndexFlat(metricType)
idxIvfFlat, _ := entity.NewIndexIvfFlat(metricType, nlist)
idxIvfSq8, _ := entity.NewIndexIvfSQ8(metricType, nlist)
idxIvfPq, _ := entity.NewIndexIvfPQ(metricType, nlist, 16, 8)
idxHnsw, _ := entity.NewIndexHNSW(metricType, 8, 96)
idxScann, _ := entity.NewIndexSCANN(metricType, 16, false)
idxDiskAnn, _ := entity.NewIndexDISKANN(metricType)

allFloatIndex := []entity.Index{
idxFlat,
idxIvfFlat,
idxIvfSq8,
idxIvfPq,
idxHnsw,
idxScann,
idxDiskAnn,
var allFloatIndex []entity.Index
for _, metricType := range SupportFloatMetricType {
idxFlat, _ := entity.NewIndexFlat(metricType)
idxIvfFlat, _ := entity.NewIndexIvfFlat(metricType, nlist)
idxIvfSq8, _ := entity.NewIndexIvfSQ8(metricType, nlist)
idxIvfPq, _ := entity.NewIndexIvfPQ(metricType, nlist, 16, 8)
idxHnsw, _ := entity.NewIndexHNSW(metricType, 8, 96)
idxScann, _ := entity.NewIndexSCANN(metricType, 16, false)
idxDiskAnn, _ := entity.NewIndexDISKANN(metricType)
allFloatIndex = append(allFloatIndex, idxFlat, idxIvfFlat, idxIvfSq8, idxIvfPq, idxHnsw, idxScann, idxDiskAnn)
}
return allFloatIndex
}
Expand Down
Loading

0 comments on commit 3844d10

Please sign in to comment.