@delali/narsil 0.3.1-next.91 → 0.3.1-next.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/browser/{chunk-66KYAOIK.mjs → chunk-3U636ADD.mjs} +2 -2
- package/dist/browser/{chunk-NOUZ6RH3.mjs → chunk-D3CC2NMZ.mjs} +238 -114
- package/dist/browser/{chunk-3ZRMZIH4.mjs → chunk-FYFQJKFW.mjs} +208 -78
- package/dist/browser/{chunk-FHFFWLEK.mjs → chunk-HARBSUWP.mjs} +3 -4
- package/dist/browser/{chunk-B6XE7KXY.mjs → chunk-LULHQXCK.mjs} +4 -4
- package/dist/browser/{chunk-NQW2YXEX.mjs → chunk-WKPJ4E73.mjs} +1 -1
- package/dist/browser/{durability-wiring-F4OGQUSU.mjs → durability-wiring-3ZRKSPJD.mjs} +498 -71
- package/dist/browser/{module-E25UDADM.mjs → module-IEOQI5GI.mjs} +102 -54
- package/dist/browser/release-76MXRPGV.mjs +33 -0
- package/dist/browser/replace-RURXTGVG.mjs +57 -0
- package/dist/browser/restore-queue-RBULSOVX.mjs +35 -0
- package/dist/browser/{snapshot-5EJ7I7QY.mjs → snapshot-Y3NGUJHX.mjs} +362 -103
- package/dist/browser/{write-K5V4XQ72.mjs → write-ZUBDNLCH.mjs} +4 -4
- package/dist/{capabilities-CvExBThq.d.ts → capabilities-BvxvFzVA.d.ts} +2 -2
- package/dist/{chunk-NVL4ZR3K.mjs → chunk-2GZGBOQI.mjs} +2 -2
- package/dist/{chunk-XLJ2S2BH.mjs → chunk-3LYY62M6.mjs} +40 -21
- package/dist/{chunk-CVQWQVFX.mjs → chunk-4ZJWRETC.mjs} +2 -2
- package/dist/{chunk-T4DB5YFB.mjs → chunk-54HYC5FT.mjs} +6 -6
- package/dist/{chunk-ZIJ63TBT.mjs → chunk-7KC56574.mjs} +1 -1
- package/dist/{chunk-67Z2V6TC.mjs → chunk-7QONURHW.mjs} +3 -3
- package/dist/{chunk-BVOJIYRV.mjs → chunk-BB7MASRQ.mjs} +1 -1
- package/dist/{chunk-6VZ3Q73N.mjs → chunk-CHOGQSHK.mjs} +44 -25
- package/dist/{chunk-QZN3MIJ3.mjs → chunk-ES33L3HO.mjs} +2 -2
- package/dist/{chunk-YCJLVNWR.mjs → chunk-F52QGNZ2.mjs} +1 -1
- package/dist/{chunk-43ORORN6.mjs → chunk-GJZHU4FC.mjs} +3 -3
- package/dist/{chunk-R7OSDAFK.mjs → chunk-HBVLF3HA.mjs} +1 -1
- package/dist/{chunk-ULRPNYAG.mjs → chunk-ICL2AELD.mjs} +120 -62
- package/dist/{chunk-3RDS4UHC.mjs → chunk-J7SDAOTP.mjs} +4 -4
- package/dist/{chunk-A4G7JSYO.mjs → chunk-JFUE6F2Y.mjs} +98 -49
- package/dist/chunk-KOKM4PQN.mjs +52 -0
- package/dist/{chunk-7OQHSDK6.mjs → chunk-L26LEDHO.mjs} +7 -7
- package/dist/{chunk-EONIHG3V.mjs → chunk-MASE2LTJ.mjs} +7 -7
- package/dist/{chunk-MXS5HWIH.mjs → chunk-MWT5WCJ5.mjs} +89 -17
- package/dist/{chunk-3TTYK5A7.mjs → chunk-Q4UTU5ZE.mjs} +9 -9
- package/dist/{chunk-T6CNO72J.mjs → chunk-QM3VPX4Z.mjs} +2 -2
- package/dist/chunk-QY7GC2MW.mjs +33 -0
- package/dist/{chunk-BJ2YKRNX.mjs → chunk-R36MIGBU.mjs} +86 -54
- package/dist/{chunk-RVM7AODE.mjs → chunk-RDJKYKMQ.mjs} +2 -2
- package/dist/{chunk-UXQE2ROB.mjs → chunk-RUIXODYU.mjs} +3 -2
- package/dist/{chunk-5ER245FI.mjs → chunk-SBCEHIPL.mjs} +3 -3
- package/dist/{chunk-TPJU7NDJ.mjs → chunk-SYWGORQB.mjs} +1 -0
- package/dist/{chunk-UKSUENHK.mjs → chunk-T2QN2FA4.mjs} +40 -26
- package/dist/{chunk-CO4MRKST.mjs → chunk-WLOF6HSP.mjs} +2 -2
- package/dist/{chunk-MKWUXWQH.mjs → chunk-ZHS44YKF.mjs} +1 -1
- package/dist/{client-Cc42b42j.d.ts → client-DKwterMb.d.ts} +2 -2
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +1 -0
- package/dist/{config-DyRowvVP.d.ts → config-6YBtxekG.d.ts} +1 -1
- package/dist/{config-BYne-yCI.d.ts → config-DPphZfuM.d.ts} +1 -1
- package/dist/direct-executor-5KJGVQHM.mjs +22 -0
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +5 -5
- package/dist/distribution.mjs +26 -26
- package/dist/{durability-wiring-6AN4QTT3.mjs → durability-wiring-FRPV6JLZ.mjs} +518 -91
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-96_kLtSY.d.ts → engine-BGt9lI1V.d.ts} +11 -11
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +18 -18
- package/dist/{memory-dd3GESdc.d.ts → memory-COdoGthn.d.ts} +96 -76
- package/dist/{module-WIDYIJLY.mjs → module-IUTNXWMV.mjs} +72 -38
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.mjs +21 -21
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +1 -0
- package/dist/release-BH3DKW3T.mjs +33 -0
- package/dist/replace-CEO5KJJ3.mjs +57 -0
- package/dist/restore-queue-I5SI6AUQ.mjs +35 -0
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +10 -10
- package/dist/snapshot-YC6TS4OP.mjs +738 -0
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-DA1Ff0G4.d.ts → tasks-BJmamiC4.d.ts} +1 -1
- package/dist/{thread-VTDLLYXC.mjs → thread-U7XYJWGG.mjs} +15 -12
- package/dist/vector/search-worker.mjs +6 -6
- package/dist/workers/entry.mjs +5 -5
- package/dist/{write-OJR3H4BI.mjs → write-M2OALSA4.mjs} +20 -20
- package/package.json +7 -7
- package/dist/chunk-Y2F66IQJ.mjs +0 -74
- package/dist/chunk-ZJ4CSAB2.mjs +0 -13
- package/dist/direct-executor-CHXVCBN7.mjs +0 -22
- package/dist/snapshot-JFZVOGZV.mjs +0 -479
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
2
|
-
import { B as BatchResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, L as ListParams, h as ListResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, m as NarsilEventMap } from './memory-
|
|
2
|
+
import { B as BatchResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, L as ListParams, h as ListResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, m as NarsilEventMap } from './memory-COdoGthn.js';
|
|
3
3
|
import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-DttzM-ln.js';
|
|
4
4
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
5
5
|
|
|
@@ -371,24 +371,24 @@ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, Syno
|
|
|
371
371
|
* Creates an index from a snapshot under the name that you pass, replacing
|
|
372
372
|
* any index of that name.
|
|
373
373
|
*
|
|
374
|
-
* The engine accepts the archive that {@link Narsil.snapshot} streams
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
* every document, so a failed check leaves the existing index unchanged.
|
|
374
|
+
* The engine accepts the archive that {@link Narsil.snapshot} streams and
|
|
375
|
+
* the `.nrsl` file of release 0.3. It checks each archive file against its
|
|
376
|
+
* manifest and loads the restored index beside the existing one, which
|
|
377
|
+
* answers requests until the swap. A failed restore leaves the existing index
|
|
378
|
+
* serving, and after a crash the engine reopens either the old or the new one.
|
|
380
379
|
*
|
|
381
380
|
* @param indexName - The name that the restored index takes.
|
|
382
|
-
* @param data - The snapshot's bytes, as
|
|
383
|
-
* iterable of chunks.
|
|
381
|
+
* @param data - The snapshot's bytes, as an array, a stream, or async chunks.
|
|
384
382
|
* @throws A `NarsilError` with `PERSISTENCE_LOAD_FAILED` when the archive is
|
|
385
383
|
* malformed or a file's length differs from the manifest. The engine raises
|
|
386
384
|
* `PERSISTENCE_CRC_MISMATCH` when a file's checksum differs from its
|
|
387
385
|
* contents, and `ENVELOPE_VERSION_MISMATCH` when a file has a format version
|
|
388
386
|
* other than the ones that this release implements. It raises
|
|
389
|
-
* `CONFIG_INVALID` when the archive's configuration is invalid,
|
|
387
|
+
* `CONFIG_INVALID` when the archive's configuration is invalid,
|
|
390
388
|
* `DOC_VALIDATION_FAILED` when the data is empty or the release 0.3 file is
|
|
391
|
-
* invalid
|
|
389
|
+
* invalid, `RESTORE_MEMORY_EXCEEDED` when the restored index and the one that
|
|
390
|
+
* it replaces need more memory than is free, and `WORKER_TIMEOUT` when a
|
|
391
|
+
* worker still holds the old index 30 seconds after the engine asks for it.
|
|
392
392
|
*/
|
|
393
393
|
restore(indexName: string, data: ByteSource): Promise<void>;
|
|
394
394
|
/**
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-
|
|
2
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError, isSimdAvailable } from './browser/chunk-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-D3CC2NMZ.mjs';
|
|
2
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError, isSimdAvailable } from './browser/chunk-HARBSUWP.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
|
|
|
6
6
|
export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
8
8
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
9
|
-
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, n as ComparisonFilter, D as DocumentImportResult, o as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, p as FacetResult, q as FieldFilter, r as FilterExpression, G as GeoFilter, s as GeoPolygonFilter, t as GeoRadiusFilter, u as GroupConfig, v as GroupReducer, w as GroupResult, H as HighlightConfig, x as HighlightMatch, y as Hit, z as HybridConfig, I as IndexInfo, g as IndexStats, L as ListParams, h as ListResult, J as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, f as NarsilEventHandlers, m as NarsilEventMap, P as PartitionStatsResult, j as PreflightResult, K as PresenceFilter, O as ProcessMemoryReport, R as QueryCoverage, Q as QueryParams, e as QueryResult, T as ScoreComponents, U as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, W as SortField, X as SortSpec, Y as StringFilter, k as SuggestParams, l as SuggestResult, Z as TermMatchPolicy, V as VectorMaintenanceResult, _ as VectorQueryConfig, $ as WorkerCopyReport, i as isNarsilError } from './memory-
|
|
10
|
-
import { N as NarsilConfig } from './config-
|
|
11
|
-
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-
|
|
12
|
-
import { N as Narsil } from './engine-
|
|
13
|
-
export { B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-
|
|
9
|
+
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, n as ComparisonFilter, D as DocumentImportResult, o as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, p as FacetResult, q as FieldFilter, r as FilterExpression, G as GeoFilter, s as GeoPolygonFilter, t as GeoRadiusFilter, u as GroupConfig, v as GroupReducer, w as GroupResult, H as HighlightConfig, x as HighlightMatch, y as Hit, z as HybridConfig, I as IndexInfo, g as IndexStats, L as ListParams, h as ListResult, J as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, f as NarsilEventHandlers, m as NarsilEventMap, P as PartitionStatsResult, j as PreflightResult, K as PresenceFilter, O as ProcessMemoryReport, R as QueryCoverage, Q as QueryParams, e as QueryResult, T as ScoreComponents, U as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, W as SortField, X as SortSpec, Y as StringFilter, k as SuggestParams, l as SuggestResult, Z as TermMatchPolicy, V as VectorMaintenanceResult, _ as VectorQueryConfig, $ as WorkerCopyReport, i as isNarsilError } from './memory-COdoGthn.js';
|
|
10
|
+
import { N as NarsilConfig } from './config-DPphZfuM.js';
|
|
11
|
+
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-DPphZfuM.js';
|
|
12
|
+
import { N as Narsil } from './engine-BGt9lI1V.js';
|
|
13
|
+
export { B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-BGt9lI1V.js';
|
|
14
14
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter } from './adapters-79OIa4xm.js';
|
|
15
15
|
|
|
16
16
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export { VERSION, createNarsil } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { registerPartialWordSearch, registerPatternSearch } from './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
export { VERSION, createNarsil } from './chunk-JFUE6F2Y.mjs';
|
|
2
|
+
import './chunk-R36MIGBU.mjs';
|
|
3
|
+
import './chunk-RDJKYKMQ.mjs';
|
|
4
|
+
export { registerSynonyms } from './chunk-3LYY62M6.mjs';
|
|
5
|
+
export { registerPartialWordSearch, registerPatternSearch } from './chunk-CHOGQSHK.mjs';
|
|
6
|
+
import './chunk-WLOF6HSP.mjs';
|
|
7
7
|
import './chunk-AV4IJKD2.mjs';
|
|
8
|
-
export { getLanguage, registerLanguage } from './chunk-MKWUXWQH.mjs';
|
|
9
8
|
import './chunk-Q5DC6WAB.mjs';
|
|
9
|
+
export { getLanguage, registerLanguage } from './chunk-ZHS44YKF.mjs';
|
|
10
10
|
import './chunk-TGP5M5R7.mjs';
|
|
11
11
|
import './chunk-U2BKYEC7.mjs';
|
|
12
|
-
export { isSimdAvailable } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
12
|
+
export { isSimdAvailable } from './chunk-KOKM4PQN.mjs';
|
|
13
|
+
import './chunk-QY7GC2MW.mjs';
|
|
14
|
+
import './chunk-ES33L3HO.mjs';
|
|
15
|
+
import './chunk-QM3VPX4Z.mjs';
|
|
16
16
|
import './chunk-WQBCBKY3.mjs';
|
|
17
|
-
import './chunk-
|
|
18
|
-
import './chunk-
|
|
17
|
+
import './chunk-SBCEHIPL.mjs';
|
|
18
|
+
import './chunk-4ZJWRETC.mjs';
|
|
19
19
|
import './chunk-FGMGUDHX.mjs';
|
|
20
20
|
import './chunk-KEHK2O6P.mjs';
|
|
21
21
|
import './chunk-GES7U2PM.mjs';
|
|
22
|
-
import './chunk-
|
|
23
|
-
export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerStopWords, registerTokenizer } from './chunk-
|
|
22
|
+
import './chunk-BB7MASRQ.mjs';
|
|
23
|
+
export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerStopWords, registerTokenizer } from './chunk-2GZGBOQI.mjs';
|
|
24
24
|
import './chunk-X5CV2E2B.mjs';
|
|
25
25
|
import './chunk-7X5JST5L.mjs';
|
|
26
|
-
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-
|
|
26
|
+
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-7KC56574.mjs';
|
|
27
27
|
import './chunk-R6A773WK.mjs';
|
|
28
28
|
import './chunk-YTJCGKM4.mjs';
|
|
29
29
|
import './chunk-R6PR4WYZ.mjs';
|
|
30
|
-
import './chunk-
|
|
30
|
+
import './chunk-HBVLF3HA.mjs';
|
|
31
31
|
import './chunk-L5ORED7V.mjs';
|
|
32
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
32
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-SYWGORQB.mjs';
|
|
@@ -46,6 +46,7 @@ declare const ErrorCodes: {
|
|
|
46
46
|
readonly ENVELOPE_VERSION_MISMATCH: "ENVELOPE_VERSION_MISMATCH";
|
|
47
47
|
readonly ENVELOPE_INVALID_MAGIC: "ENVELOPE_INVALID_MAGIC";
|
|
48
48
|
readonly PARTITION_CAPACITY_EXCEEDED: "PARTITION_CAPACITY_EXCEEDED";
|
|
49
|
+
readonly RESTORE_MEMORY_EXCEEDED: "RESTORE_MEMORY_EXCEEDED";
|
|
49
50
|
readonly EMBEDDING_FAILED: "EMBEDDING_FAILED";
|
|
50
51
|
readonly EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH";
|
|
51
52
|
readonly EMBEDDING_NO_SOURCE: "EMBEDDING_NO_SOURCE";
|
|
@@ -889,6 +890,101 @@ type FilterExpression = {
|
|
|
889
890
|
not?: FilterExpression;
|
|
890
891
|
};
|
|
891
892
|
|
|
893
|
+
/**
|
|
894
|
+
* Vector-search inputs passed under `QueryParams.vector`.
|
|
895
|
+
*
|
|
896
|
+
* Supply either a raw `value` array or a `text` string for auto-embedding;
|
|
897
|
+
* passing both throws `EMBEDDING_CONFIG_INVALID`. Result count is governed
|
|
898
|
+
* by the outer query's `limit`, not by any field on this object.
|
|
899
|
+
*
|
|
900
|
+
* @public
|
|
901
|
+
*/
|
|
902
|
+
interface VectorQueryConfig {
|
|
903
|
+
/**
|
|
904
|
+
* Name of the schema field that holds the vector to compare against.
|
|
905
|
+
* Must reference a field declared as `vector[N]` in the index schema.
|
|
906
|
+
*/
|
|
907
|
+
field: string;
|
|
908
|
+
/**
|
|
909
|
+
* Raw query vector, given as a number array or a `Float32Array`. Length
|
|
910
|
+
* must match the indexed field's dimension or the search rejects the
|
|
911
|
+
* request with `VECTOR_DIMENSION_MISMATCH`.
|
|
912
|
+
*/
|
|
913
|
+
value?: number[] | Float32Array;
|
|
914
|
+
/**
|
|
915
|
+
* Text to embed at query time using the index or instance embedding
|
|
916
|
+
* adapter. Mutually exclusive with `value`; requires a configured adapter.
|
|
917
|
+
*/
|
|
918
|
+
text?: string;
|
|
919
|
+
/**
|
|
920
|
+
* Score floor applied during ranking. Hits scoring below this value
|
|
921
|
+
* are dropped before `limit` is enforced, so the returned hit count
|
|
922
|
+
* can be smaller than `limit` even when more documents exist. The
|
|
923
|
+
* floor is interpreted in score space for every metric; for
|
|
924
|
+
* `euclidean`, distance is mapped to a similarity score of
|
|
925
|
+
* `1 / (1 + distance)` first. Defaults to no floor.
|
|
926
|
+
*/
|
|
927
|
+
similarity?: number;
|
|
928
|
+
/**
|
|
929
|
+
* Similarity metric used for ranking. Defaults to `cosine`. Choose
|
|
930
|
+
* `dotProduct` for raw inner-product scoring on already-normalised
|
|
931
|
+
* vectors and `euclidean` for distance-based ordering.
|
|
932
|
+
*/
|
|
933
|
+
metric?: 'cosine' | 'dotProduct' | 'euclidean';
|
|
934
|
+
/**
|
|
935
|
+
* The engine keeps this many candidates as it walks the HNSW graph, so a
|
|
936
|
+
* higher value can find more of the true neighbours, although each query
|
|
937
|
+
* takes longer. The engine applies it only once the field holds a graph.
|
|
938
|
+
* The engine fetches k hits, where k is one more than the number of hits up
|
|
939
|
+
* to the end of the page, so k is `limit` plus 1 on a first page. When a
|
|
940
|
+
* query leaves `efSearch` unset, the engine keeps the larger of 50 and k
|
|
941
|
+
* plus a margin, where the margin is 50 below 768 dimensions, 75 from 768
|
|
942
|
+
* to 1,023 dimensions, and 0 at 1,024 dimensions and above. Under a
|
|
943
|
+
* filter, the engine counts only the candidates that pass the filter.
|
|
944
|
+
*/
|
|
945
|
+
efSearch?: number;
|
|
946
|
+
/**
|
|
947
|
+
* The engine re-scores this many times k candidates in a quantized field
|
|
948
|
+
* against the full-precision vectors before it returns the best `limit`,
|
|
949
|
+
* where k is one more than the number of hits up to the end of the page, so
|
|
950
|
+
* k is `limit` plus 1 on a first page. For a value below 1, or for a value
|
|
951
|
+
* that is not a finite number, the engine throws a `NarsilError` with code
|
|
952
|
+
* `CONFIG_INVALID`. The engine ignores it on a field whose quantization is
|
|
953
|
+
* `none`. When a query leaves it unset, the engine sets the number of
|
|
954
|
+
* candidates that it re-scores from k and from the field's dimension. It
|
|
955
|
+
* rounds that number up, and it re-scores at least 3k candidates under
|
|
956
|
+
* `osq1` and `osq2`, and at least k under `osq4` and `osq8`. Below 768
|
|
957
|
+
* dimensions, it re-scores 3.23k + 55.9√k under `osq1` and 2.6k + 22.5√k under
|
|
958
|
+
* `osq2`. From 768 to 1,023 dimensions, it re-scores 2.2k + 27√k under
|
|
959
|
+
* `osq1` and k + 16√k under `osq2`. At 1,024 dimensions and above, it
|
|
960
|
+
* re-scores 3k under both. Under `osq4`, it re-scores 5k below 1,024
|
|
961
|
+
* dimensions and 2k from 1,024 dimensions, while under `osq8` it re-scores
|
|
962
|
+
* 2k at every dimension. Under a filter, the engine counts only the
|
|
963
|
+
* candidates that pass the filter. On vectors spread evenly across every
|
|
964
|
+
* dimension, a one-bit or two-bit code can find fewer than 95% of the true
|
|
965
|
+
* nearest neighbours at these defaults, so raise `oversample` on a query that
|
|
966
|
+
* needs more of them.
|
|
967
|
+
*/
|
|
968
|
+
oversample?: number;
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* How a hybrid query merges its keyword ranking with its vector ranking.
|
|
972
|
+
*
|
|
973
|
+
* `rrf` combines the two by rank alone, which needs no tuning and handles
|
|
974
|
+
* scores that live on different scales. `linear` blends the scores directly,
|
|
975
|
+
* which gives you control once you know what each side's scores look like.
|
|
976
|
+
*
|
|
977
|
+
* @public
|
|
978
|
+
*/
|
|
979
|
+
interface HybridConfig {
|
|
980
|
+
/** The engine merges the rankings this way, and by rank fusion by default. It throws `CONFIG_INVALID` for any other value. */
|
|
981
|
+
strategy?: 'rrf' | 'linear';
|
|
982
|
+
/** The engine uses this rank-fusion constant under `rrf` alone, where a larger value reduces the lead of the top ranks. Set a whole number of at least 1, or leave it out for 60. The engine throws `CONFIG_INVALID` for any other value. */
|
|
983
|
+
k?: number;
|
|
984
|
+
/** The engine uses this weight of the vector score, from 0 to 1, under `linear` alone, and 0.5 where you leave it out. It throws `CONFIG_INVALID` for a value outside that range. */
|
|
985
|
+
alpha?: number;
|
|
986
|
+
}
|
|
987
|
+
|
|
892
988
|
/**
|
|
893
989
|
* Everything {@link Narsil.suggest} accepts.
|
|
894
990
|
*
|
|
@@ -1169,82 +1265,6 @@ type DocumentProjection = boolean | {
|
|
|
1169
1265
|
/** Names the fields to drop, so every other field is kept. */
|
|
1170
1266
|
exclude?: string[];
|
|
1171
1267
|
};
|
|
1172
|
-
/**
|
|
1173
|
-
* Vector-search inputs passed under `QueryParams.vector`.
|
|
1174
|
-
*
|
|
1175
|
-
* Supply either a raw `value` array or a `text` string for auto-embedding;
|
|
1176
|
-
* passing both throws `EMBEDDING_CONFIG_INVALID`. Result count is governed
|
|
1177
|
-
* by the outer query's `limit`, not by any field on this object.
|
|
1178
|
-
*
|
|
1179
|
-
* @public
|
|
1180
|
-
*/
|
|
1181
|
-
interface VectorQueryConfig {
|
|
1182
|
-
/**
|
|
1183
|
-
* Name of the schema field that holds the vector to compare against.
|
|
1184
|
-
* Must reference a field declared as `vector[N]` in the index schema.
|
|
1185
|
-
*/
|
|
1186
|
-
field: string;
|
|
1187
|
-
/**
|
|
1188
|
-
* Raw query vector, given as a number array or a `Float32Array`. Length
|
|
1189
|
-
* must match the indexed field's dimension or the search rejects the
|
|
1190
|
-
* request with `VECTOR_DIMENSION_MISMATCH`.
|
|
1191
|
-
*/
|
|
1192
|
-
value?: number[] | Float32Array;
|
|
1193
|
-
/**
|
|
1194
|
-
* Text to embed at query time using the index or instance embedding
|
|
1195
|
-
* adapter. Mutually exclusive with `value`; requires a configured adapter.
|
|
1196
|
-
*/
|
|
1197
|
-
text?: string;
|
|
1198
|
-
/**
|
|
1199
|
-
* Score floor applied during ranking. Hits scoring below this value
|
|
1200
|
-
* are dropped before `limit` is enforced, so the returned hit count
|
|
1201
|
-
* can be smaller than `limit` even when more documents exist. The
|
|
1202
|
-
* floor is interpreted in score space for every metric; for
|
|
1203
|
-
* `euclidean`, distance is mapped to a similarity score of
|
|
1204
|
-
* `1 / (1 + distance)` first. Defaults to no floor.
|
|
1205
|
-
*/
|
|
1206
|
-
similarity?: number;
|
|
1207
|
-
/**
|
|
1208
|
-
* Similarity metric used for ranking. Defaults to `cosine`. Choose
|
|
1209
|
-
* `dotProduct` for raw inner-product scoring on already-normalised
|
|
1210
|
-
* vectors and `euclidean` for distance-based ordering.
|
|
1211
|
-
*/
|
|
1212
|
-
metric?: 'cosine' | 'dotProduct' | 'euclidean';
|
|
1213
|
-
/**
|
|
1214
|
-
* HNSW exploration factor for approximate search. Higher values raise
|
|
1215
|
-
* recall at the cost of latency. Ignored while the field is still
|
|
1216
|
-
* served by the brute-force backend. Defaults to the engine's built-in
|
|
1217
|
-
* value when omitted.
|
|
1218
|
-
*/
|
|
1219
|
-
efSearch?: number;
|
|
1220
|
-
/**
|
|
1221
|
-
* How many times `limit` a quantized field re-scores against its
|
|
1222
|
-
* full-precision vectors before it returns the best `limit`. A value below
|
|
1223
|
-
* 1 or one that is not a finite number fails with `CONFIG_INVALID`. The
|
|
1224
|
-
* engine ignores this on a field whose quantization is `none`. When a query
|
|
1225
|
-
* omits it, the engine takes 3 for `osq1` and `osq2`, 2 for `osq8`, and 2
|
|
1226
|
-
* for `osq4` at 1,024 dimensions and above, but 5 for `osq4` below 1,024,
|
|
1227
|
-
* where a four-bit code ranks the true neighbours less reliably.
|
|
1228
|
-
*/
|
|
1229
|
-
oversample?: number;
|
|
1230
|
-
}
|
|
1231
|
-
/**
|
|
1232
|
-
* How a hybrid query merges its keyword ranking with its vector ranking.
|
|
1233
|
-
*
|
|
1234
|
-
* `rrf` combines the two by rank alone, which needs no tuning and handles
|
|
1235
|
-
* scores that live on different scales. `linear` blends the scores directly,
|
|
1236
|
-
* which gives you control once you know what each side's scores look like.
|
|
1237
|
-
*
|
|
1238
|
-
* @public
|
|
1239
|
-
*/
|
|
1240
|
-
interface HybridConfig {
|
|
1241
|
-
/** The engine merges the rankings this way, and by rank fusion by default. It throws `CONFIG_INVALID` for any other value. */
|
|
1242
|
-
strategy?: 'rrf' | 'linear';
|
|
1243
|
-
/** The engine uses this rank-fusion constant under `rrf` alone, where a larger value reduces the lead of the top ranks. Set a whole number of at least 1, or leave it out for 60. The engine throws `CONFIG_INVALID` for any other value. */
|
|
1244
|
-
k?: number;
|
|
1245
|
-
/** The engine uses this weight of the vector score, from 0 to 1, under `linear` alone, and 0.5 where you leave it out. It throws `CONFIG_INVALID` for a value outside that range. */
|
|
1246
|
-
alpha?: number;
|
|
1247
|
-
}
|
|
1248
1268
|
/**
|
|
1249
1269
|
* Fields a query counts values for, keyed by field name.
|
|
1250
1270
|
*
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { VECTOR_WORKER_COPIES_ALLOWED, DEFAULT_PROMOTION_THRESHOLD, DEFAULT_FILTER_THRESHOLD, recordCheckpoint, planCheckpoint, deserialize, assignStorePartitions, liveSize, threadsHoldCurrentLayout, filterForOptions, OSQ4_MIN_DIMENSION, emptyFieldBeforeRestore, ESTIMATED_MS_PER_TOMBSTONE, graphNeedsRebuild, ESTIMATED_MS_PER_VECTOR_REBUILD, releaseReplacedVectors, WORKER_COPY_MIN_VECTORS, allLiveDocIds, recalibrateFromStore, signatureOf, adoptGraph, calibrateQuantizer, fieldHandlesOf, BUILD_CHUNK_SIZE, yieldToEventLoop, DISK_ADOPTION_YIELD_INTERVAL } from './chunk-
|
|
2
|
-
import { isDead, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors } from './chunk-
|
|
3
|
-
import { createVectorStore } from './chunk-
|
|
4
|
-
export { openSharedVectorField } from './chunk-
|
|
5
|
-
import { osqBitsOf, createOsqQuantizer, ordinalFilterValues, STORE_UNPLACED_COUNT, STORE_LIVE_COUNT, STORE_REMOVED_COUNT, createOrdinalFilter, addToOrdinalFilter, nativeScoresOf, toScore, ordinalFilterHas, magnitude, nativeStoreScratchBytes, toDistance, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createHNSWIndex, topLayerInParts, sharedMemoryAvailable, requireWholeNeighbourLists, releaseLocksHeldBy } from './chunk-
|
|
6
|
-
export { releaseLocksHeldBy } from './chunk-
|
|
1
|
+
import { VECTOR_WORKER_COPIES_ALLOWED, DEFAULT_PROMOTION_THRESHOLD, DEFAULT_FILTER_THRESHOLD, recordCheckpoint, planCheckpoint, deserialize, assignStorePartitions, liveSize, ordinalFilterForSubsets, threadsHoldCurrentLayout, filterForOptions, OSQ4_MIN_DIMENSION, emptyFieldBeforeRestore, ESTIMATED_MS_PER_TOMBSTONE, graphNeedsRebuild, ESTIMATED_MS_PER_VECTOR_REBUILD, releaseReplacedVectors, WORKER_COPY_MIN_VECTORS, allLiveDocIds, recalibrateFromStore, signatureOf, adoptGraph, calibrateQuantizer, fieldHandlesOf, BUILD_CHUNK_SIZE, yieldToEventLoop, DISK_ADOPTION_YIELD_INTERVAL } from './chunk-MWT5WCJ5.mjs';
|
|
2
|
+
import { isDead, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors } from './chunk-F52QGNZ2.mjs';
|
|
3
|
+
import { createVectorStore } from './chunk-T2QN2FA4.mjs';
|
|
4
|
+
export { openSharedVectorField } from './chunk-T2QN2FA4.mjs';
|
|
5
|
+
import { osqBitsOf, createOsqQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, ordinalFilterValues, STORE_UNPLACED_COUNT, STORE_LIVE_COUNT, STORE_REMOVED_COUNT, createOrdinalFilter, addToOrdinalFilter, nativeScoresOf, toScore, ordinalFilterHas, magnitude, nativeStoreScratchBytes, toDistance, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createHNSWIndex, topLayerInParts, sharedMemoryAvailable, requireWholeNeighbourLists, releaseLocksHeldBy } from './chunk-ICL2AELD.mjs';
|
|
6
|
+
export { releaseLocksHeldBy } from './chunk-ICL2AELD.mjs';
|
|
7
7
|
import './chunk-37CD3OKS.mjs';
|
|
8
8
|
import { noteFallback } from './chunk-DJHHF2L5.mjs';
|
|
9
9
|
import { spawnNodeWorker } from './chunk-C7SLA6CM.mjs';
|
|
10
|
-
import { resolveWorkerCount, resolveWorkerEntry, workerResourceLimits } from './chunk-
|
|
10
|
+
import { resolveWorkerCount, resolveWorkerEntry, workerResourceLimits } from './chunk-RDJKYKMQ.mjs';
|
|
11
11
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
12
12
|
import './chunk-Q5DC6WAB.mjs';
|
|
13
|
-
import
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
13
|
+
import './chunk-KOKM4PQN.mjs';
|
|
14
|
+
import { MAX_RENUMBERED_SEARCH_ATTEMPTS, DISK_STORAGE_BLOCK_BYTES, UNPLACED_FLAG_CHUNK_ORDINALS, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, GRAPH_BUILD_DISPATCH_CHUNK, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_INSERT_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS } from './chunk-QY7GC2MW.mjs';
|
|
15
|
+
import './chunk-ES33L3HO.mjs';
|
|
16
16
|
import './chunk-FGMGUDHX.mjs';
|
|
17
17
|
import './chunk-KEHK2O6P.mjs';
|
|
18
18
|
import './chunk-R6A773WK.mjs';
|
|
19
19
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
20
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
20
|
+
import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
|
|
21
21
|
|
|
22
22
|
// src/core/heap.ts
|
|
23
23
|
function createMaxHeap(compare) {
|
|
@@ -220,14 +220,21 @@ function scoreCandidates(store, candidates, query, k, metric, minSimilarity) {
|
|
|
220
220
|
function createSharedVectorSearcher(options) {
|
|
221
221
|
const { fieldName, view, holdsDocument } = options;
|
|
222
222
|
const flags = readStoreFlags(view.store);
|
|
223
|
-
function
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
223
|
+
function ordinalLayoutGeneration() {
|
|
224
|
+
return Atomics.load(view.store.handles.header, STORE_ORDINAL_LAYOUT_GENERATION);
|
|
225
|
+
}
|
|
226
|
+
function ordinalSpace() {
|
|
227
|
+
const store = view.store;
|
|
228
|
+
const layoutGeneration = ordinalLayoutGeneration();
|
|
229
|
+
return {
|
|
230
|
+
fieldName,
|
|
231
|
+
layoutGeneration,
|
|
232
|
+
slots: store.slots,
|
|
233
|
+
header: store.handles.header,
|
|
234
|
+
ordinalOf: (docId) => view.ordinalOf(docId),
|
|
235
|
+
holdsCurrentOrdinal: (ordinal) => store.holdsOrdinal(ordinal) && store.partitionAt(ordinal) !== void 0,
|
|
236
|
+
isRemoved: (ordinal) => flags.isRemoved(ordinal)
|
|
237
|
+
};
|
|
231
238
|
}
|
|
232
239
|
function filterForPartitions(allowed) {
|
|
233
240
|
const slots = view.store.slots;
|
|
@@ -241,7 +248,9 @@ function createSharedVectorSearcher(options) {
|
|
|
241
248
|
return filter;
|
|
242
249
|
}
|
|
243
250
|
function filterFor(searchOptions) {
|
|
244
|
-
if (searchOptions.
|
|
251
|
+
if (searchOptions.filterSubsets !== void 0) {
|
|
252
|
+
return ordinalFilterForSubsets(searchOptions.filterSubsets, ordinalSpace());
|
|
253
|
+
}
|
|
245
254
|
if (searchOptions.filterPartitions !== void 0) return filterForPartitions(searchOptions.filterPartitions);
|
|
246
255
|
return void 0;
|
|
247
256
|
}
|
|
@@ -257,6 +266,11 @@ function createSharedVectorSearcher(options) {
|
|
|
257
266
|
}
|
|
258
267
|
return candidates;
|
|
259
268
|
}
|
|
269
|
+
function answerOf(outcome) {
|
|
270
|
+
const results = outcome.results.filter((result) => holdsDocument(result.docId));
|
|
271
|
+
const holdsEveryHit = outcome.resolvedEveryHit && results.length === outcome.results.length;
|
|
272
|
+
return { results, matched: outcome.matched, matchedExact: outcome.matchedExact && holdsEveryHit };
|
|
273
|
+
}
|
|
260
274
|
function scanned(scan) {
|
|
261
275
|
return { results: scan.results, matched: scan.matched, matchedExact: true, resolvedEveryHit: true };
|
|
262
276
|
}
|
|
@@ -315,21 +329,25 @@ function createSharedVectorSearcher(options) {
|
|
|
315
329
|
{ expected: view.handles.dimension, received: query.length }
|
|
316
330
|
);
|
|
317
331
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
332
|
+
for (let attempt = 1; ; attempt++) {
|
|
333
|
+
const layoutGeneration = ordinalLayoutGeneration();
|
|
334
|
+
const outcome = search2(query, k, searchOptions, filterFor(searchOptions));
|
|
335
|
+
if (view.graphRetired) {
|
|
336
|
+
throw new NarsilError(
|
|
337
|
+
ErrorCodes.WORKER_BUSY,
|
|
338
|
+
`The main thread replaced the graph of vector field "${fieldName}" while this thread searched it`,
|
|
339
|
+
{ fieldName }
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
if (ordinalLayoutGeneration() === layoutGeneration) return Promise.resolve(answerOf(outcome));
|
|
343
|
+
if (attempt >= MAX_RENUMBERED_SEARCH_ATTEMPTS) {
|
|
344
|
+
throw new NarsilError(
|
|
345
|
+
ErrorCodes.WORKER_BUSY,
|
|
346
|
+
`The main thread renumbered the vectors of field "${fieldName}" during each of ${attempt} searches on this thread`,
|
|
347
|
+
{ fieldName, attempts: attempt }
|
|
348
|
+
);
|
|
349
|
+
}
|
|
325
350
|
}
|
|
326
|
-
const results = outcome.results.filter((result) => holdsDocument(result.docId));
|
|
327
|
-
const holdsEveryHit = outcome.resolvedEveryHit && results.length === outcome.results.length;
|
|
328
|
-
return Promise.resolve({
|
|
329
|
-
results,
|
|
330
|
-
matched: outcome.matched,
|
|
331
|
-
matchedExact: outcome.matchedExact && holdsEveryHit
|
|
332
|
-
});
|
|
333
351
|
}
|
|
334
352
|
};
|
|
335
353
|
}
|
|
@@ -659,6 +677,11 @@ async function withdrawWorkerCopies(state) {
|
|
|
659
677
|
await Promise.all([...handles].map((handle) => dropHandle(state, handle)));
|
|
660
678
|
if (state.workerCopies.host === void 0 && state.sharedHandles.size === 0) state.workerCopyPool = null;
|
|
661
679
|
}
|
|
680
|
+
async function holdWorkerCopies(state) {
|
|
681
|
+
state.workerCopiesHeld = true;
|
|
682
|
+
await state.sharing;
|
|
683
|
+
await withdrawWorkerCopies(state);
|
|
684
|
+
}
|
|
662
685
|
function noteWrite(state) {
|
|
663
686
|
state.revision += 1;
|
|
664
687
|
if (state.workerCopyMode === "clone") invalidateWorkerCopies(state);
|
|
@@ -757,7 +780,7 @@ async function loadOnPool(state, graph, searchable) {
|
|
|
757
780
|
}
|
|
758
781
|
function shareGraph(state, graph, searchable) {
|
|
759
782
|
const run = state.sharing.then(async () => {
|
|
760
|
-
if (!state.workerCopies.enabled || state.disposed) return null;
|
|
783
|
+
if (!state.workerCopies.enabled || state.disposed || state.workerCopiesHeld) return null;
|
|
761
784
|
const existing = state.sharedHandles.get(graph);
|
|
762
785
|
const layoutUnchanged = threadsHoldCurrentLayout(state);
|
|
763
786
|
if (existing !== void 0 && layoutUnchanged && (existing.searchable || !searchable)) return existing.handle;
|
|
@@ -772,7 +795,7 @@ function shareGraph(state, graph, searchable) {
|
|
|
772
795
|
}
|
|
773
796
|
function resendSharedHandles(state) {
|
|
774
797
|
const run = state.sharing.then(async () => {
|
|
775
|
-
if (!state.workerCopies.enabled || state.disposed) return;
|
|
798
|
+
if (!state.workerCopies.enabled || state.disposed || state.workerCopiesHeld) return;
|
|
776
799
|
const host = state.workerCopies.host;
|
|
777
800
|
for (const [graph, shared] of [...state.sharedHandles]) {
|
|
778
801
|
if (host !== void 0) await loadOnHost(state, host, graph, shared.searchable);
|
|
@@ -786,7 +809,7 @@ function resendSharedHandles(state) {
|
|
|
786
809
|
return run;
|
|
787
810
|
}
|
|
788
811
|
function scheduleWorkerCopyLoad(state) {
|
|
789
|
-
if (!state.workerCopies.enabled) return;
|
|
812
|
+
if (!state.workerCopies.enabled || state.workerCopiesHeld) return;
|
|
790
813
|
if (state.disposed || state.workerCopyLoading || state.building) return;
|
|
791
814
|
const graph = state.hnsw;
|
|
792
815
|
const host = state.workerCopies.host;
|
|
@@ -1634,6 +1657,7 @@ function createVectorIndex(fieldName, dimension, config, workerCopies = VECTOR_W
|
|
|
1634
1657
|
workerCopyRevision: -1,
|
|
1635
1658
|
workerCopyMode: null,
|
|
1636
1659
|
workerCopyLoading: false,
|
|
1660
|
+
workerCopiesHeld: false,
|
|
1637
1661
|
sharedHandles: /* @__PURE__ */ new Map(),
|
|
1638
1662
|
sharedLayoutRevision: 0,
|
|
1639
1663
|
sharing: Promise.resolve(),
|
|
@@ -1731,7 +1755,7 @@ function createVectorIndex(fieldName, dimension, config, workerCopies = VECTOR_W
|
|
|
1731
1755
|
releaseHeldMemory();
|
|
1732
1756
|
}
|
|
1733
1757
|
async function searchParallel(query, k, options) {
|
|
1734
|
-
const confined = options.
|
|
1758
|
+
const confined = options.filterSubsets !== void 0 || options.filterPartitions !== void 0;
|
|
1735
1759
|
let filter = filterForOptions(state, options);
|
|
1736
1760
|
if (filter !== void 0) {
|
|
1737
1761
|
if (state.hnsw) {
|
|
@@ -1812,6 +1836,16 @@ function createVectorIndex(fieldName, dimension, config, workerCopies = VECTOR_W
|
|
|
1812
1836
|
releaseVectorFiles: async () => {
|
|
1813
1837
|
await withdrawWorkerCopies(state);
|
|
1814
1838
|
state.store.closeFiles();
|
|
1839
|
+
},
|
|
1840
|
+
relocateVectorFiles: (rewrite) => {
|
|
1841
|
+
state.store.relocateVectorFiles(rewrite);
|
|
1842
|
+
for (const [docId, location] of state.pendingLocations) {
|
|
1843
|
+
state.pendingLocations.set(docId, { ...location, path: rewrite(location.path) });
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
holdWorkerCopies: () => holdWorkerCopies(state),
|
|
1847
|
+
resumeWorkerCopies: () => {
|
|
1848
|
+
state.workerCopiesHeld = false;
|
|
1815
1849
|
}
|
|
1816
1850
|
};
|
|
1817
1851
|
}
|
package/dist/partial-words.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { partialWordSearchModule } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { partialWordSearchModule } from './chunk-SBCEHIPL.mjs';
|
|
2
|
+
import './chunk-4ZJWRETC.mjs';
|
|
3
3
|
import './chunk-FGMGUDHX.mjs';
|
|
4
4
|
import './chunk-KEHK2O6P.mjs';
|
|
5
5
|
import './chunk-GES7U2PM.mjs';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
6
|
+
import './chunk-BB7MASRQ.mjs';
|
|
7
|
+
import './chunk-7KC56574.mjs';
|
|
8
8
|
import './chunk-R6A773WK.mjs';
|
|
9
9
|
import './chunk-YTJCGKM4.mjs';
|
|
10
10
|
import './chunk-L5ORED7V.mjs';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-SYWGORQB.mjs';
|
|
12
12
|
|
|
13
13
|
// src/partial-words/index.ts
|
|
14
14
|
var partialWordSearch = partialWordSearchModule;
|
package/dist/pattern.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { patternSearchModule } from './chunk-
|
|
1
|
+
import { patternSearchModule } from './chunk-QM3VPX4Z.mjs';
|
|
2
2
|
import './chunk-WQBCBKY3.mjs';
|
|
3
3
|
import './chunk-GES7U2PM.mjs';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-BB7MASRQ.mjs';
|
|
5
5
|
import './chunk-YTJCGKM4.mjs';
|
|
6
6
|
import './chunk-L5ORED7V.mjs';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-SYWGORQB.mjs';
|
|
8
8
|
|
|
9
9
|
// src/pattern/index.ts
|
|
10
10
|
var patternSearch = patternSearchModule;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { createDurableDirectory } from '../../chunk-
|
|
1
|
+
import { createDurableDirectory } from '../../chunk-7QONURHW.mjs';
|
|
2
2
|
import '../../chunk-C7SLA6CM.mjs';
|
|
3
|
-
import { CHECKPOINT_WORKER_HEARTBEAT_MS, writeCheckpointSegments, directoryCheckpointStore } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
3
|
+
import { CHECKPOINT_WORKER_HEARTBEAT_MS, writeCheckpointSegments, directoryCheckpointStore } from '../../chunk-Q4UTU5ZE.mjs';
|
|
4
|
+
import '../../chunk-J7SDAOTP.mjs';
|
|
5
5
|
import '../../chunk-OHP7QR33.mjs';
|
|
6
6
|
import '../../chunk-P36MUFEJ.mjs';
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-JFUE6F2Y.mjs';
|
|
8
|
+
import '../../chunk-R36MIGBU.mjs';
|
|
9
|
+
import '../../chunk-RDJKYKMQ.mjs';
|
|
10
|
+
import '../../chunk-3LYY62M6.mjs';
|
|
11
|
+
import '../../chunk-CHOGQSHK.mjs';
|
|
12
|
+
import '../../chunk-WLOF6HSP.mjs';
|
|
13
13
|
import '../../chunk-AV4IJKD2.mjs';
|
|
14
|
-
import '../../chunk-MKWUXWQH.mjs';
|
|
15
14
|
import '../../chunk-Q5DC6WAB.mjs';
|
|
15
|
+
import '../../chunk-ZHS44YKF.mjs';
|
|
16
16
|
import '../../chunk-TGP5M5R7.mjs';
|
|
17
17
|
import '../../chunk-U2BKYEC7.mjs';
|
|
18
|
-
import '../../chunk-
|
|
19
|
-
import '../../chunk-
|
|
20
|
-
import '../../chunk-
|
|
21
|
-
import '../../chunk-
|
|
18
|
+
import '../../chunk-KOKM4PQN.mjs';
|
|
19
|
+
import '../../chunk-QY7GC2MW.mjs';
|
|
20
|
+
import '../../chunk-ES33L3HO.mjs';
|
|
21
|
+
import '../../chunk-QM3VPX4Z.mjs';
|
|
22
22
|
import '../../chunk-WQBCBKY3.mjs';
|
|
23
|
-
import '../../chunk-
|
|
24
|
-
import '../../chunk-
|
|
23
|
+
import '../../chunk-SBCEHIPL.mjs';
|
|
24
|
+
import '../../chunk-4ZJWRETC.mjs';
|
|
25
25
|
import '../../chunk-FGMGUDHX.mjs';
|
|
26
26
|
import '../../chunk-KEHK2O6P.mjs';
|
|
27
27
|
import '../../chunk-GES7U2PM.mjs';
|
|
28
|
-
import '../../chunk-
|
|
29
|
-
import '../../chunk-
|
|
28
|
+
import '../../chunk-BB7MASRQ.mjs';
|
|
29
|
+
import '../../chunk-2GZGBOQI.mjs';
|
|
30
30
|
import '../../chunk-X5CV2E2B.mjs';
|
|
31
31
|
import '../../chunk-7X5JST5L.mjs';
|
|
32
|
-
import '../../chunk-
|
|
32
|
+
import '../../chunk-7KC56574.mjs';
|
|
33
33
|
import '../../chunk-R6A773WK.mjs';
|
|
34
34
|
import '../../chunk-YTJCGKM4.mjs';
|
|
35
35
|
import '../../chunk-R6PR4WYZ.mjs';
|
|
36
|
-
import '../../chunk-
|
|
36
|
+
import '../../chunk-HBVLF3HA.mjs';
|
|
37
37
|
import '../../chunk-L5ORED7V.mjs';
|
|
38
|
-
import '../../chunk-
|
|
38
|
+
import '../../chunk-SYWGORQB.mjs';
|
|
39
39
|
|
|
40
40
|
// src/persistence/durability/rebuild.ts
|
|
41
41
|
async function rebuildSegmentsFromDurable(root, metadata, targets, compactionThreshold, prior, capturedPartitions = []) {
|