Skip to content

Commit

Permalink
Switch to new filterStrategy naming convention (#35)
Browse files Browse the repository at this point in the history
* Switch to new filterStrategy naming convention

* Fix naming of filter parameter
  • Loading branch information
trengrj authored Oct 11, 2024
1 parent 2125664 commit 0cbb0fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ benchmark-data
results
output.png
.venv
.env
5 changes: 2 additions & 3 deletions benchmarker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ Flags:
--efArray string Array of ef parameters as comma separated list (default "16,24,32,48,64,96,128,256,512")
--efConstruction int Set Weaviate efConstruction parameter (default 256) (default 256)
--existingSchema Leave the schema as-is (default false)
--filter Threshold to trigger the update in the dynamic index (default 10 000)
--filteredSearch Use an ACORN like search
--filteredSearchCache Cache two hops expansion for ACORN like search
--filter Whether to use filtering for the dataset (default false)
--filterStrategy Use a different filter strategy such as "acorn"
--flatSearchCutoff int Flat search cut off (default 40 000) (default 40000)
-f, --format string Output format, one of [text, json] (default "text")
-h, --help help for ann-benchmark
Expand Down
15 changes: 4 additions & 11 deletions benchmarker/cmd/ann_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,7 @@ func createSchema(cfg *Config, client *weaviate.Client) {
log.Fatalf("Unknown index type %s", cfg.IndexType)
}

if cfg.FilteredSearch {
vectorIndexConfig["filteredSearch"] = map[string]interface{}{
"enabled": true,
"cache2h": cfg.FilteredSearchCache,
}
}
vectorIndexConfig["filterStrategy"] = cfg.FilterStrategy

classObj.VectorIndexConfig = vectorIndexConfig

Expand Down Expand Up @@ -1121,13 +1116,11 @@ func initAnnBenchmark() {
annBenchmarkCommand.PersistentFlags().IntVar(&globalConfig.DynamicThreshold,
"dynamicThreshold", 10_000, "Threshold to trigger the update in the dynamic index (default 10 000)")
annBenchmarkCommand.PersistentFlags().BoolVar(&globalConfig.Filter,
"filter", false, "Threshold to trigger the update in the dynamic index (default 10 000)")
"filter", false, "Whether to use filtering for the dataset (default false)")
annBenchmarkCommand.PersistentFlags().IntVar(&globalConfig.FlatSearchCutoff,
"flatSearchCutoff", 40000, "Flat search cut off (default 40 000)")
annBenchmarkCommand.PersistentFlags().BoolVar(&globalConfig.FilteredSearch,
"filteredSearch", false, "Use an ACORN like search")
annBenchmarkCommand.PersistentFlags().BoolVar(&globalConfig.FilteredSearchCache,
"filteredSearchCache", false, "Cache two hops expansion for ACORN like search")
annBenchmarkCommand.PersistentFlags().StringVar(&globalConfig.FilterStrategy,
"filterStrategy", "sweeping", "Use a different filter strategy (options are sweeping or acorn)")
annBenchmarkCommand.PersistentFlags().IntVar(&globalConfig.ReplicationFactor,
"replicationFactor", 1, "Replication factor")
}
Expand Down
3 changes: 1 addition & 2 deletions benchmarker/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ type Config struct {
DynamicThreshold int
Filter bool
FlatSearchCutoff int
FilteredSearch bool
FilteredSearchCache bool
FilterStrategy string
}

func (c *Config) Validate() error {
Expand Down

0 comments on commit 0cbb0fd

Please sign in to comment.