Skip to content

Commit

Permalink
Add missing filterStrategy to configure/reconfigure hnsw methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmith023 committed Nov 13, 2024
1 parent df40cc3 commit 86aa9d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/collections/configure/types/vectorIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export type VectorIndexConfigHNSWCreateOptions = {
efConstruction?: number;
/** The flat search cutoff. Default is 40000. */
flatSearchCutoff?: number;
/** The filter strategy to use. Default is 'sweeping'. */
filterStrategy?: VectorIndexFilterStrategy;
/** The maximum number of connections. Default is 64. */
maxConnections?: number;
/** The quantizer configuration to use. Use `vectorIndex.quantizer.bq` or `vectorIndex.quantizer.pq` to make one. */
Expand Down
2 changes: 2 additions & 0 deletions src/collections/configure/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ describe('Unit testing of the configure & reconfigure factory classes', () => {
ef: 100,
efConstruction: 256,
flatSearchCutoff: 80000,
filterStrategy: 'acorn',
maxConnections: 128,
quantizer: configure.vectorIndex.quantizer.pq({
bitCompression: true,
Expand All @@ -163,6 +164,7 @@ describe('Unit testing of the configure & reconfigure factory classes', () => {
ef: 100,
efConstruction: 256,
flatSearchCutoff: 80000,
filterStrategy: 'acorn',
maxConnections: 128,
quantizer: {
bitCompression: true,
Expand Down
9 changes: 8 additions & 1 deletion src/collections/configure/vectorIndex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ModuleConfig, PQEncoderDistribution, PQEncoderType, VectorDistance } from '../config/types/index.js';
import {
ModuleConfig,
PQEncoderDistribution,
PQEncoderType,
VectorIndexFilterStrategy,
} from '../config/types/index.js';
import {
BQConfigCreate,
BQConfigUpdate,
Expand Down Expand Up @@ -187,6 +192,7 @@ const reconfigure = {
* @param {number} [options.dynamicEfMax] The dynamic ef max. Default is 500.
* @param {number} [options.dynamicEfMin] The dynamic ef min. Default is 100.
* @param {number} [options.ef] The ef parameter. Default is -1.
* @param {VectorIndexFilterStrategy} [options.filterStrategy] The filter strategy. Default is 'sweeping'.
* @param {number} [options.flatSearchCutoff] The flat search cutoff. Default is 40000.
* @param {PQConfigUpdate | BQConfigUpdate} [options.quantizer] The quantizer configuration to use. Use `vectorIndex.quantizer.bq` or `vectorIndex.quantizer.pq` to make one.
* @param {number} [options.vectorCacheMaxObjects] The maximum number of objects to cache in the vector cache. Default is 1000000000000.
Expand All @@ -197,6 +203,7 @@ const reconfigure = {
dynamicEfMax?: number;
dynamicEfMin?: number;
ef?: number;
filterStrategy?: VectorIndexFilterStrategy;
flatSearchCutoff?: number;
quantizer?: PQConfigUpdate | BQConfigUpdate | SQConfigUpdate;
vectorCacheMaxObjects?: number;
Expand Down

0 comments on commit 86aa9d9

Please sign in to comment.