Skip to content

Commit 86aa9d9

Browse files
committed
Add missing filterStrategy to configure/reconfigure hnsw methods
1 parent df40cc3 commit 86aa9d9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/collections/configure/types/vectorIndex.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ export type VectorIndexConfigHNSWCreateOptions = {
126126
efConstruction?: number;
127127
/** The flat search cutoff. Default is 40000. */
128128
flatSearchCutoff?: number;
129+
/** The filter strategy to use. Default is 'sweeping'. */
130+
filterStrategy?: VectorIndexFilterStrategy;
129131
/** The maximum number of connections. Default is 64. */
130132
maxConnections?: number;
131133
/** The quantizer configuration to use. Use `vectorIndex.quantizer.bq` or `vectorIndex.quantizer.pq` to make one. */

src/collections/configure/unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ describe('Unit testing of the configure & reconfigure factory classes', () => {
138138
ef: 100,
139139
efConstruction: 256,
140140
flatSearchCutoff: 80000,
141+
filterStrategy: 'acorn',
141142
maxConnections: 128,
142143
quantizer: configure.vectorIndex.quantizer.pq({
143144
bitCompression: true,
@@ -163,6 +164,7 @@ describe('Unit testing of the configure & reconfigure factory classes', () => {
163164
ef: 100,
164165
efConstruction: 256,
165166
flatSearchCutoff: 80000,
167+
filterStrategy: 'acorn',
166168
maxConnections: 128,
167169
quantizer: {
168170
bitCompression: true,

src/collections/configure/vectorIndex.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { ModuleConfig, PQEncoderDistribution, PQEncoderType, VectorDistance } from '../config/types/index.js';
1+
import {
2+
ModuleConfig,
3+
PQEncoderDistribution,
4+
PQEncoderType,
5+
VectorIndexFilterStrategy,
6+
} from '../config/types/index.js';
27
import {
38
BQConfigCreate,
49
BQConfigUpdate,
@@ -187,6 +192,7 @@ const reconfigure = {
187192
* @param {number} [options.dynamicEfMax] The dynamic ef max. Default is 500.
188193
* @param {number} [options.dynamicEfMin] The dynamic ef min. Default is 100.
189194
* @param {number} [options.ef] The ef parameter. Default is -1.
195+
* @param {VectorIndexFilterStrategy} [options.filterStrategy] The filter strategy. Default is 'sweeping'.
190196
* @param {number} [options.flatSearchCutoff] The flat search cutoff. Default is 40000.
191197
* @param {PQConfigUpdate | BQConfigUpdate} [options.quantizer] The quantizer configuration to use. Use `vectorIndex.quantizer.bq` or `vectorIndex.quantizer.pq` to make one.
192198
* @param {number} [options.vectorCacheMaxObjects] The maximum number of objects to cache in the vector cache. Default is 1000000000000.
@@ -197,6 +203,7 @@ const reconfigure = {
197203
dynamicEfMax?: number;
198204
dynamicEfMin?: number;
199205
ef?: number;
206+
filterStrategy?: VectorIndexFilterStrategy;
200207
flatSearchCutoff?: number;
201208
quantizer?: PQConfigUpdate | BQConfigUpdate | SQConfigUpdate;
202209
vectorCacheMaxObjects?: number;

0 commit comments

Comments
 (0)