Skip to content

Commit 34a9fd6

Browse files
authored
Merge pull request #88 from weaviate/rob/fix-dynamic-index
fix: Dynamic index
2 parents 6ebfc86 + 12c2089 commit 34a9fd6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

benchmarker/cmd/ann_benchmark.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ func createSchema(cfg *Config, client *weaviate.Client) {
321321
"cleanupIntervalSeconds": cfg.CleanupIntervalSeconds,
322322
"flatSearchCutoff": cfg.FlatSearchCutoff,
323323
},
324+
"flat": map[string]interface{}{},
324325
}
325326
if cfg.PQ == "auto" {
326327
pqConfig := map[string]interface{}{
@@ -342,6 +343,10 @@ func createSchema(cfg *Config, client *weaviate.Client) {
342343
}
343344
vectorIndexConfig["hnsw"].(map[string]interface{})["bq"] = bqConfig
344345
} else if cfg.RQ == "auto" {
346+
vectorIndexConfig["flat"].(map[string]interface{})["rq"] = map[string]interface{}{
347+
"enabled": true,
348+
"bits": cfg.RQBits,
349+
}
345350
vectorIndexConfig["hnsw"].(map[string]interface{})["rq"] = map[string]interface{}{
346351
"enabled": true,
347352
"bits": cfg.RQBits,
@@ -534,6 +539,14 @@ func updateEf(ef int, cfg *Config, client *weaviate.Client) {
534539
case "dynamic":
535540
hnswConfig := vectorIndexConfig["hnsw"].(map[string]interface{})
536541
hnswConfig["ef"] = ef
542+
flatConfig := vectorIndexConfig["flat"].(map[string]interface{})
543+
if bq, exists := flatConfig["bq"]; exists && cfg.BQ {
544+
bqConfig := bq.(map[string]interface{})
545+
bqConfig["rescoreLimit"] = ef
546+
} else if rq, exists := flatConfig["rq"]; exists {
547+
rqConfig := rq.(map[string]interface{})
548+
rqConfig["rescoreLimit"] = ef
549+
}
537550
case "hfresh":
538551
vectorIndexConfig["searchProbe"] = ef
539552
}

0 commit comments

Comments
 (0)