@delali/narsil 0.3.1-next.129 → 0.3.1-next.130
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-26A5JFT2.mjs +89 -0
- package/dist/browser/{chunk-5D6NJD6C.mjs → chunk-2Y3CO4EQ.mjs} +342 -201
- package/dist/browser/{chunk-WLD6DDIX.mjs → chunk-AIIJDWMG.mjs} +1 -1
- package/dist/browser/{chunk-YAGXZU4W.mjs → chunk-D7WQF6DV.mjs} +2 -2
- package/dist/browser/{chunk-WZBTVTSU.mjs → chunk-M5UAAXGU.mjs} +2 -2
- package/dist/browser/{chunk-XTFJZHQP.mjs → chunk-NSCSR6MA.mjs} +15 -5
- package/dist/browser/{chunk-3NVZD52E.mjs → chunk-UDGB2MWT.mjs} +5 -28
- package/dist/browser/{chunk-II5POT55.mjs → chunk-VBBLTD7O.mjs} +4 -3
- package/dist/browser/chunk-VEGHFP2P.mjs +30 -0
- package/dist/browser/{durability-wiring-HCCC6BJB.mjs → durability-wiring-FNZSRH4N.mjs} +8 -6
- package/dist/browser/{module-S2VDU2JE.mjs → module-4HIMOQM5.mjs} +6 -5
- package/dist/browser/phrase-module-WESYVU7K.mjs +327 -0
- package/dist/browser/{restore-queue-BZ7WWEC4.mjs → restore-queue-GEZ54CA5.mjs} +1 -1
- package/dist/browser/{runtime-PL4TTFJE.mjs → runtime-3X7ZJ5T3.mjs} +2 -1
- package/dist/browser/{snapshot-RTUCHI2L.mjs → snapshot-V7VF6BN6.mjs} +25 -10
- package/dist/browser/{write-IMU7G5NU.mjs → write-YIC2MKRY.mjs} +7 -5
- package/dist/{capabilities-BTjv-tK8.d.ts → capabilities-Bl8G9taj.d.ts} +2 -2
- package/dist/{chunk-3XHFVYIQ.mjs → chunk-2C3WXBQS.mjs} +1 -1
- package/dist/{chunk-37RTD6KD.mjs → chunk-2JWNJSNE.mjs} +8 -8
- package/dist/{chunk-K76F5YYX.mjs → chunk-2MKX2SCO.mjs} +219 -58
- package/dist/{chunk-AN3CUMPZ.mjs → chunk-2SEL6SBS.mjs} +4 -95
- package/dist/{chunk-OPO5SE4J.mjs → chunk-2WBY4Y4M.mjs} +1 -1
- package/dist/{chunk-PTIJAZWL.mjs → chunk-4GDLFDPZ.mjs} +1 -1
- package/dist/chunk-4UMZ7KQL.mjs +17 -0
- package/dist/{chunk-TY64A3ZW.mjs → chunk-5LX6MOIB.mjs} +2 -2
- package/dist/{chunk-PCRWCOZC.mjs → chunk-6M6SDH3S.mjs} +43 -23
- package/dist/{chunk-MGD7XETB.mjs → chunk-6SSVIW7Y.mjs} +19 -3
- package/dist/{chunk-5LC5VMDQ.mjs → chunk-7OIQ2SIO.mjs} +4 -4
- package/dist/{chunk-4XEVROSP.mjs → chunk-7XY6VD7B.mjs} +1 -1
- package/dist/{chunk-WI5Q3L43.mjs → chunk-CZ7ISLXA.mjs} +2 -0
- package/dist/{chunk-RC27KF7F.mjs → chunk-D5TFRB5G.mjs} +3 -15
- package/dist/{chunk-F4UKMTKM.mjs → chunk-EUCX5K74.mjs} +4 -4
- package/dist/{chunk-CTF6WFTX.mjs → chunk-F6AAXI7T.mjs} +3 -3
- package/dist/{chunk-DX2FI4LU.mjs → chunk-FQBFZAWG.mjs} +3 -1
- package/dist/{chunk-XTER67YM.mjs → chunk-HCGJKDZV.mjs} +1 -1
- package/dist/{chunk-WQYB4TNR.mjs → chunk-JJ6EUMXB.mjs} +2 -2
- package/dist/{chunk-2HQQ7Y5D.mjs → chunk-JT3YZGCE.mjs} +2 -2
- package/dist/chunk-JUKYYXSP.mjs +93 -0
- package/dist/{chunk-WUIDPBSY.mjs → chunk-K77FJXKS.mjs} +17 -7
- package/dist/{chunk-CSSCLRGY.mjs → chunk-NMXRXFGZ.mjs} +2 -2
- package/dist/{chunk-44TB6AIZ.mjs → chunk-NNO7CO3A.mjs} +1 -1
- package/dist/{chunk-FRSWYMXH.mjs → chunk-PATMDIMN.mjs} +1 -1
- package/dist/{chunk-AFOZR4ZQ.mjs → chunk-PU6SKH7O.mjs} +2 -2
- package/dist/{chunk-EZIGAOUJ.mjs → chunk-QQTXT65X.mjs} +6 -5
- package/dist/{chunk-Y4NOHICF.mjs → chunk-RNSC4NFI.mjs} +1 -1
- package/dist/{chunk-RYH3PASD.mjs → chunk-RWESFSJI.mjs} +21 -11
- package/dist/{chunk-QQS4QZQA.mjs → chunk-SOHMMNCH.mjs} +4 -4
- package/dist/{chunk-K73PZTBR.mjs → chunk-SZGRYEIC.mjs} +4 -4
- package/dist/{chunk-43Q7HAI2.mjs → chunk-T4OFG4IQ.mjs} +4 -4
- package/dist/{chunk-2YOAGAGF.mjs → chunk-TGHNXN7W.mjs} +59 -30
- package/dist/{chunk-J4LRE5Q7.mjs → chunk-WVRDRLIC.mjs} +6 -6
- package/dist/{chunk-XRXBCOA4.mjs → chunk-X5CNUKD5.mjs} +2 -2
- package/dist/{chunk-TB7YMDD5.mjs → chunk-XABMCBHA.mjs} +6 -4
- package/dist/{chunk-Y4US5EGH.mjs → chunk-Y2U5VVWX.mjs} +1 -1
- package/dist/{chunk-5VSTAJET.mjs → chunk-Y4BVTQ53.mjs} +2 -2
- package/dist/{chunk-3LJVM6XM.mjs → chunk-YBWSV5DV.mjs} +2 -2
- package/dist/{chunk-M6MBSVIJ.mjs → chunk-ZR4VM4A6.mjs} +1 -1
- package/dist/{client-BOcveV7A.d.ts → client-Cx-TiqPE.d.ts} +3 -3
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +2 -0
- package/dist/{config-CPmIY3aH.d.ts → config-CzB9YvF_.d.ts} +2 -2
- package/dist/{config-C3YXk5Rn.d.ts → config-hOWGBeC6.d.ts} +7 -5
- package/dist/direct-executor-HQ4QVDX7.mjs +28 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +85 -45
- package/dist/{durability-wiring-6R26AJDI.mjs → durability-wiring-S7OX2MAI.mjs} +27 -25
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-JjRAXpT3.d.ts → engine-B_W9sdZK.d.ts} +2 -2
- package/dist/{events-pM0lna7M.d.ts → events-DErop1LM.d.ts} +12 -2
- package/dist/{index-DkQ2DlgR.d.ts → index-CKI1fDEl.d.ts} +1 -1
- package/dist/index.browser.mjs +5 -3
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +20 -18
- package/dist/{long-query-thread-6VLA6YJI.mjs → long-query-thread-WVSMIBYP.mjs} +17 -15
- package/dist/{module-S4WGMFNW.mjs → module-2E4XYSGT.mjs} +11 -11
- package/dist/partial-words.mjs +7 -6
- package/dist/pattern.mjs +4 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +2 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +23 -21
- package/dist/phrase-module-JERF2IDG.mjs +329 -0
- package/dist/react.d.ts +7 -7
- package/dist/react.mjs +2 -0
- package/dist/{rerank-V4J4MIWR.mjs → rerank-DMMT4FZA.mjs} +6 -6
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{restore-queue-PUGWCPCX.mjs → restore-queue-JAMNRC6T.mjs} +1 -1
- package/dist/{runtime-TBFBQQQO.mjs → runtime-7MLQ7J64.mjs} +7 -7
- package/dist/{schema-DGAP_8HJ.d.ts → schema-CS-clLun.d.ts} +4 -4
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +15 -15
- package/dist/{snapshot-PUVSMV7E.mjs → snapshot-DOQLGGEX.mjs} +44 -29
- package/dist/synonyms.mjs +4 -3
- package/dist/{tasks-txGvNz6h.d.ts → tasks-BfF-VRhm.d.ts} +2 -2
- package/dist/{thread-TA7QQBWP.mjs → thread-DNK5XWXG.mjs} +16 -14
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +4 -4
- package/dist/workers/entry.mjs +7 -7
- package/dist/{write-TGKYT3C4.mjs → write-ZKR7SNRT.mjs} +22 -20
- package/package.json +7 -7
- package/dist/direct-executor-ULA6V5HC.mjs +0 -26
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SCRATCH_SLOTS_PER_THREAD_POOL } from './chunk-QSK35UC2.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/workers/constants.ts
|
|
5
5
|
var WORKER_YOUNG_GENERATION_MB = 24;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH } from './chunk-U476IXKQ.mjs';
|
|
2
2
|
import { EARLIER_RELEASE_MIN_M, MIN_M, MAX_M } from './chunk-VJS4JFBQ.mjs';
|
|
3
|
-
import { isWordIndexedBase, parseFieldType } from './chunk-
|
|
3
|
+
import { isWordIndexedBase, parseFieldType } from './chunk-7XY6VD7B.mjs';
|
|
4
4
|
import { compareCodePoints, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
5
5
|
import { DEFAULT_PATTERN_VALUE_LIMIT, isPlainObject, MAX_TEXT_FIELDS, MAX_VECTOR_DIMENSION, MAX_DOCUMENT_BYTES, MAX_NESTING_DEPTH, PROTOTYPE_POLLUTION_KEYS, FIELD_NAME_PATTERN, RESERVED_ROOT_FIELDS, MAX_DOCUMENT_NESTING_DEPTH, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
7
7
|
import { Encoder, encode } from '@msgpack/msgpack';
|
|
8
8
|
|
|
9
9
|
// src/schema/validator/schema.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { sendRelayed, parseJson, validateQuery, rejectInvalid, refuseRegex, respondJson, withServerRerankWindow, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerServerRoutes, closeWhenTheProcessExits, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, serverRoutes, validateSuggest, SEARCH_CLOCK_SAMPLE_UNITS, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, encodeJson } from './chunk-
|
|
1
|
+
import { sendRelayed, parseJson, validateQuery, rejectInvalid, refuseRegex, respondJson, withServerRerankWindow, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerServerRoutes, closeWhenTheProcessExits, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, serverRoutes, validateSuggest, SEARCH_CLOCK_SAMPLE_UNITS, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, encodeJson } from './chunk-XABMCBHA.mjs';
|
|
2
2
|
import { withRerankQueryText } from './chunk-KZ3NX2P7.mjs';
|
|
3
|
-
import { executeListDocuments, executeSuggest, executeQuery, lazyQueryBinding, executePreflight } from './chunk-
|
|
4
|
-
import { resolveProjection, projectionKeepsField, setNestedValue } from './chunk-
|
|
5
|
-
import { extractVectorFieldsFromSchema } from './chunk-
|
|
6
|
-
import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-
|
|
3
|
+
import { executeListDocuments, executeSuggest, executeQuery, lazyQueryBinding, executePreflight } from './chunk-6M6SDH3S.mjs';
|
|
4
|
+
import { holdsQuotedText, resolveProjection, projectionKeepsField, setNestedValue } from './chunk-2MKX2SCO.mjs';
|
|
5
|
+
import { extractVectorFieldsFromSchema } from './chunk-PU6SKH7O.mjs';
|
|
6
|
+
import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-CZ7ISLXA.mjs';
|
|
7
7
|
|
|
8
8
|
// src/server/request-threads/messages.ts
|
|
9
9
|
function isLongQueryPortNote(message) {
|
|
@@ -371,6 +371,7 @@ function createThreadReadEngine(options) {
|
|
|
371
371
|
if (searchHooks) return null;
|
|
372
372
|
const context = executor.queryContextOf(indexName);
|
|
373
373
|
if (context === void 0) return null;
|
|
374
|
+
if (context.analysisStale && params.term !== void 0 && holdsQuotedText(params.term)) return null;
|
|
374
375
|
const field = params.vector?.field;
|
|
375
376
|
if (field === void 0) return context;
|
|
376
377
|
const vectorFields = extractVectorFieldsFromSchema(context.config.schema);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { requirePatternSearchFor, requirePartialWordSearchFor, createPartitionIndex, buildPartialWordTableFrom, recordValueSize, patternIndexOf, encodeFieldIndexes, encodePartialSpellingsOf, countPartialSpelling, copyVectorsInto, isCompositePartition, fnv1a, partialSpellingsOfDocuments, createFrozenPartialWords, requirePatternSearch, documentValueBytes, cloneProjected, projectIncludedPaths, valueWithOwnBuffers, createSurfaceRegistry, MAX_TERM_FREQUENCY, joinPatternWorkMeter, fanOutQuery, sanitizeGlobalStats, countsWithoutScores, fanOutMatchCount, createCompositePartition, createGeoIndex, documentWithOwnBuffers, readProjectedPath, createNumericIndex, createBooleanIndex, createEnumIndex, ValueAffixes } from './chunk-
|
|
2
|
-
import { generateId, getLanguage } from './chunk-
|
|
1
|
+
import { requirePatternSearchFor, requirePartialWordSearchFor, createPartitionIndex, buildPartialWordTableFrom, recordValueSize, patternIndexOf, encodeFieldIndexes, encodePartialSpellingsOf, countPartialSpelling, ARRAY_POSITION_GAP, copyVectorsInto, isCompositePartition, fnv1a, partialSpellingsOfDocuments, createFrozenPartialWords, requirePatternSearch, documentValueBytes, cloneProjected, projectIncludedPaths, valueWithOwnBuffers, createSurfaceRegistry, MAX_TERM_FREQUENCY, loadPhraseCodeFor, joinPatternWorkMeter, fanOutQuery, sanitizeGlobalStats, countsWithoutScores, fanOutMatchCount, createCompositePartition, createGeoIndex, documentWithOwnBuffers, readProjectedPath, createNumericIndex, createBooleanIndex, createEnumIndex, ValueAffixes } from './chunk-2MKX2SCO.mjs';
|
|
2
|
+
import { generateId, getLanguage } from './chunk-ZR4VM4A6.mjs';
|
|
3
3
|
import { readHeapStatistics, readResidentMemory } from './chunk-ZATRDAYU.mjs';
|
|
4
|
-
import { GrowableUint32, bitsetHas, bitsetSet, createBitSet } from './chunk-
|
|
5
|
-
import { tokenizeOptions, getNestedValue, sameFields, visitDocumentSurfaceSpellings, visitDocumentSpellings } from './chunk-
|
|
6
|
-
import { schemaFieldsOf, partialFieldsOf, encodeDocument, validateDocument, validateDocumentStrict, extractVectorFieldsFromSchema } from './chunk-
|
|
4
|
+
import { GrowableUint32, bitsetHas, bitsetSet, createBitSet } from './chunk-JUKYYXSP.mjs';
|
|
5
|
+
import { tokenizeOptions, getNestedValue, sameFields, visitDocumentSurfaceSpellings, visitDocumentSpellings } from './chunk-EUCX5K74.mjs';
|
|
6
|
+
import { schemaFieldsOf, partialFieldsOf, encodeDocument, validateDocument, validateDocumentStrict, extractVectorFieldsFromSchema } from './chunk-PU6SKH7O.mjs';
|
|
7
7
|
import { fuzzyPrefixOf, boundedLevenshtein } from './chunk-GES7U2PM.mjs';
|
|
8
|
-
import { isWordIndexedBase } from './chunk-
|
|
9
|
-
import { resolveIndexAnalysis, synonymSearchModule } from './chunk-
|
|
10
|
-
import { visitTokens, codePointOrder, encodeStringBlob, encodeLookupKey
|
|
8
|
+
import { isWordIndexedBase } from './chunk-7XY6VD7B.mjs';
|
|
9
|
+
import { resolveIndexAnalysis, synonymSearchModule } from './chunk-6SSVIW7Y.mjs';
|
|
10
|
+
import { visitTokens, codePointOrder, encodeStringBlob, encodeLookupKey } from './chunk-D5TFRB5G.mjs';
|
|
11
|
+
import { SEGMENT_TOKEN_TABLE_START, SEGMENT_POSTING_LOG_START, SEGMENT_POSITION_POOL_START, SEGMENT_FIELD_SCRATCH_START, FROZEN_REMOVAL_INDEX_MAX_PROCESS_FRACTION } from './chunk-4UMZ7KQL.mjs';
|
|
11
12
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
12
|
-
import { loadedVectorCode, loadVectorCode, loadVectorCodeFor, requireLoadedVectorCode } from './chunk-
|
|
13
|
+
import { loadedVectorCode, loadVectorCode, loadVectorCodeFor, requireLoadedVectorCode } from './chunk-HCGJKDZV.mjs';
|
|
13
14
|
import { PROTOTYPE_POLLUTION_KEYS } from './chunk-L5ORED7V.mjs';
|
|
14
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
15
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
15
16
|
import { Decoder, decode } from '@msgpack/msgpack';
|
|
16
17
|
|
|
17
18
|
// src/core/synonyms/platform.ts
|
|
@@ -540,6 +541,8 @@ function createPartitionRouter() {
|
|
|
540
541
|
|
|
541
542
|
// src/workers/query-actions.ts
|
|
542
543
|
async function runQueryAction(entry, action) {
|
|
544
|
+
const loadingPhraseCode = loadPhraseCodeFor(action.params.term);
|
|
545
|
+
if (loadingPhraseCode !== null) await loadingPhraseCode;
|
|
543
546
|
const patternWork = joinPatternWorkMeter(action.patternWork, action.params.filters);
|
|
544
547
|
const bm25Params = action.type === "query" ? action.bm25 ?? void 0 : entry.config.bm25;
|
|
545
548
|
const searchOptions = { ...entry.searchOptions, patternWork, bm25Params };
|
|
@@ -1587,6 +1590,10 @@ function createFrozenPostingViews(payload, tombstones, counts) {
|
|
|
1587
1590
|
if (positionOffsets === null) return 0;
|
|
1588
1591
|
return positionOffsets[start + row + 1] - positionOffsets[start + row];
|
|
1589
1592
|
},
|
|
1593
|
+
positionStore: positionValues,
|
|
1594
|
+
positionStartAt(row) {
|
|
1595
|
+
return positionOffsets === null ? 0 : positionOffsets[start + row];
|
|
1596
|
+
},
|
|
1590
1597
|
docIdSet: {
|
|
1591
1598
|
get size() {
|
|
1592
1599
|
return counts.documentFrequency(sortedIndex);
|
|
@@ -3032,8 +3039,10 @@ function buildSegmentPayload(documents, schema, language, options, trackPosition
|
|
|
3032
3039
|
const spellings = /* @__PURE__ */ new Map();
|
|
3033
3040
|
let fieldSpellings = null;
|
|
3034
3041
|
let positionOffset = 0;
|
|
3042
|
+
let lastItemPosition = -1;
|
|
3035
3043
|
const addToken = (token, position, surface) => {
|
|
3036
3044
|
postings.addToken(token, positionOffset + position);
|
|
3045
|
+
lastItemPosition = position;
|
|
3037
3046
|
surfaces.count(surface, token);
|
|
3038
3047
|
if (fieldSpellings !== null) countPartialSpelling(fieldSpellings, token, surface ?? token, 1);
|
|
3039
3048
|
};
|
|
@@ -3052,8 +3061,9 @@ function buildSegmentPayload(documents, schema, language, options, trackPosition
|
|
|
3052
3061
|
postings.beginField();
|
|
3053
3062
|
positionOffset = 0;
|
|
3054
3063
|
for (const text of fieldType === "string" ? [value] : value) {
|
|
3064
|
+
lastItemPosition = -1;
|
|
3055
3065
|
visitTokens(text, language, tokenizing, addToken);
|
|
3056
|
-
positionOffset
|
|
3066
|
+
if (lastItemPosition >= 0) positionOffset += lastItemPosition + 1 + ARRAY_POSITION_GAP;
|
|
3057
3067
|
}
|
|
3058
3068
|
postings.endField(ordinal, fieldPath);
|
|
3059
3069
|
lengths.record(ordinal, fieldPath, postings.fieldLength);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes } from './chunk-
|
|
2
|
-
import { createOrdinalFilter, addToOrdinalFilter, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-
|
|
1
|
+
import { VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes } from './chunk-Y2U5VVWX.mjs';
|
|
2
|
+
import { createOrdinalFilter, addToOrdinalFilter, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-X5CNUKD5.mjs';
|
|
3
3
|
import { osqRecordBytes, writeRecord } from './chunk-37CD3OKS.mjs';
|
|
4
|
-
import { MAX_DOC_ID_LENGTH } from './chunk-
|
|
4
|
+
import { MAX_DOC_ID_LENGTH } from './chunk-RNSC4NFI.mjs';
|
|
5
5
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
7
7
|
|
|
8
8
|
// src/vector/filter-ordinals.ts
|
|
9
9
|
var UNRESOLVED_ORDINAL = -1;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { rerankQueryTextOf } from './chunk-KZ3NX2P7.mjs';
|
|
2
|
-
import { fixedHybridDepthOf, pageByPosition, requireWithinHybridDepth } from './chunk-
|
|
2
|
+
import { fixedHybridDepthOf, pageByPosition, requireWithinHybridDepth } from './chunk-5LX6MOIB.mjs';
|
|
3
3
|
import { DEFAULT_RERANK_WINDOW, MIN_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
|
|
4
|
-
import { DEFAULT_LIMIT, DEFAULT_OFFSET } from './chunk-
|
|
5
|
-
import { RESULT_WINDOW } from './chunk-
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
4
|
+
import { DEFAULT_LIMIT, DEFAULT_OFFSET } from './chunk-RNSC4NFI.mjs';
|
|
5
|
+
import { RESULT_WINDOW } from './chunk-FQBFZAWG.mjs';
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
7
7
|
|
|
8
8
|
// src/rerank/params.ts
|
|
9
9
|
function invalid(message, details = {}) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-P36MUFEJ.mjs';
|
|
2
|
-
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-
|
|
3
|
-
import { generateId, getLanguage } from './chunk-
|
|
4
|
-
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-
|
|
2
|
+
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-JT3YZGCE.mjs';
|
|
3
|
+
import { generateId, getLanguage } from './chunk-ZR4VM4A6.mjs';
|
|
4
|
+
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-RNSC4NFI.mjs';
|
|
5
5
|
import { decodeSynonymRules } from './chunk-7X5JST5L.mjs';
|
|
6
6
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
8
8
|
import { encode, decode } from '@msgpack/msgpack';
|
|
9
9
|
|
|
10
10
|
// src/narsil/write-blocks.ts
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, lazyQueryBinding, executeQuery, executePreflight, executeSuggest, executeListDocuments, storedBM25Params, validateDocId } from './chunk-
|
|
2
|
-
import { resolveVectorText, bindEngineCore, restoredConfigFields, restoredEmbedding, collectRequiredFieldFailures, embedChunkDocuments, providedDocId, requireDocumentObject, admitInsert, asBatchInsertError, requireMatchingDocId, embedDocumentFields, assertDocumentCarriesMappedVectors, admitBufferedUpsert, createPendingAdmissions, recordPendingAdmission } from './chunk-
|
|
3
|
-
import { splitWorkerBudget, resolveWorkerCount, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, resolveRequestThreadCount, workerResourceLimits, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-
|
|
1
|
+
import { validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, lazyQueryBinding, executeQuery, executePreflight, executeSuggest, executeListDocuments, storedBM25Params, validateDocId } from './chunk-6M6SDH3S.mjs';
|
|
2
|
+
import { resolveVectorText, bindEngineCore, restoredConfigFields, restoredEmbedding, collectRequiredFieldFailures, embedChunkDocuments, providedDocId, requireDocumentObject, admitInsert, asBatchInsertError, requireMatchingDocId, embedDocumentFields, assertDocumentCarriesMappedVectors, admitBufferedUpsert, createPendingAdmissions, recordPendingAdmission } from './chunk-JT3YZGCE.mjs';
|
|
3
|
+
import { splitWorkerBudget, resolveWorkerCount, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, resolveRequestThreadCount, workerResourceLimits, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-NNO7CO3A.mjs';
|
|
4
4
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
5
|
-
import { isEmptySynonymSet, synonymModule, createDirectExecutor, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, resolvePartitionInsertOptions, createFrozenSegment } from './chunk-
|
|
6
|
-
import { requirePatternSearchFor, requirePartialWordSearchFor, collectQueryTermStats, mergePartitionStats, createPartitionIndex, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, fnv1a, encodeSegmentState } from './chunk-
|
|
7
|
-
import { generateId, getLanguage } from './chunk-
|
|
5
|
+
import { isEmptySynonymSet, synonymModule, createDirectExecutor, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, resolvePartitionInsertOptions, createFrozenSegment } from './chunk-RWESFSJI.mjs';
|
|
6
|
+
import { ARRAY_POSITION_GAP, requirePatternSearchFor, requirePartialWordSearchFor, loadPhraseCodeFor, collectQueryTermStats, requireLoadedPhraseCode, mergePartitionStats, createPartitionIndex, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, fnv1a, encodeSegmentState } from './chunk-2MKX2SCO.mjs';
|
|
7
|
+
import { generateId, getLanguage } from './chunk-ZR4VM4A6.mjs';
|
|
8
8
|
import { readHeapStatistics } from './chunk-ZATRDAYU.mjs';
|
|
9
9
|
import { countEngineThread } from './chunk-EBIHRL7B.mjs';
|
|
10
10
|
import { DEFAULT_MAX_RERANK_WINDOW, DEFAULT_RERANK_TIMEOUT_MS } from './chunk-HJSN7UYG.mjs';
|
|
11
|
-
import { MAX_INDEX_CONFIGURATION_BYTES, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, HEAP_PRESSURE_WARNING_FRACTION, FOREIGN_STATS_TTL_MS, MAX_IMPORT_REFUSALS_REPORTED, MIN_DOCUMENTS_FOR_SEGMENTS, HEAP_PRESSURE_REARM_FRACTION, BATCH_CHUNK_SIZE } from './chunk-
|
|
12
|
-
import { requireSearchBackendSettings } from './chunk-
|
|
13
|
-
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-
|
|
14
|
-
import { getNestedValue } from './chunk-
|
|
15
|
-
import { flattenSchema, raiseEarlierReleaseGraphSetting, messagePackUpperBoundBytes, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage,
|
|
11
|
+
import { MAX_INDEX_CONFIGURATION_BYTES, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, HEAP_PRESSURE_WARNING_FRACTION, FOREIGN_STATS_TTL_MS, MAX_IMPORT_REFUSALS_REPORTED, MIN_DOCUMENTS_FOR_SEGMENTS, HEAP_PRESSURE_REARM_FRACTION, BATCH_CHUNK_SIZE } from './chunk-RNSC4NFI.mjs';
|
|
12
|
+
import { requireSearchBackendSettings } from './chunk-2C3WXBQS.mjs';
|
|
13
|
+
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-2SEL6SBS.mjs';
|
|
14
|
+
import { getNestedValue } from './chunk-EUCX5K74.mjs';
|
|
15
|
+
import { flattenSchema, raiseEarlierReleaseGraphSetting, messagePackUpperBoundBytes, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, schemaFieldsOf, extractVectorFieldsFromSchema, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-PU6SKH7O.mjs';
|
|
16
16
|
import { NATIVE_CRC32_MIN_BYTES, MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-U476IXKQ.mjs';
|
|
17
|
-
import { isSingleStringFieldType } from './chunk-
|
|
18
|
-
import { withOpenIndex, oneAtATime } from './chunk-
|
|
17
|
+
import { isSingleStringFieldType } from './chunk-7XY6VD7B.mjs';
|
|
18
|
+
import { withOpenIndex, oneAtATime } from './chunk-6SSVIW7Y.mjs';
|
|
19
19
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
20
20
|
import { createRequestId, isValidWorkerResponse } from './chunk-UJWGQIXU.mjs';
|
|
21
|
-
import { loadVectorCodeFor, requireLoadedVectorCode } from './chunk-
|
|
21
|
+
import { loadVectorCodeFor, requireLoadedVectorCode } from './chunk-HCGJKDZV.mjs';
|
|
22
22
|
import { noteThreadSlotLive, threadSlotOfWorker, noteThreadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
23
23
|
import { MAX_DOCUMENT_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
|
|
24
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
24
|
+
import { ErrorCodes, NarsilError } from './chunk-CZ7ISLXA.mjs';
|
|
25
25
|
import { encode, decode } from '@msgpack/msgpack';
|
|
26
26
|
import * as zlib from 'zlib';
|
|
27
27
|
|
|
@@ -686,6 +686,7 @@ function createAnalysisRebuildCoordinator(config, deps) {
|
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
return {
|
|
689
|
+
rebuildMode,
|
|
689
690
|
markStale(index) {
|
|
690
691
|
const existing = stale.get(index.indexName);
|
|
691
692
|
if (existing !== void 0 && existing.run !== null) {
|
|
@@ -814,6 +815,17 @@ function resolveDurabilityTier(config) {
|
|
|
814
815
|
return { kind: "snapshot", config: {}, adapter: config.persistence };
|
|
815
816
|
}
|
|
816
817
|
|
|
818
|
+
// src/engine/array-positions.ts
|
|
819
|
+
function holdsStringArrayField(schema) {
|
|
820
|
+
return schemaFieldsOf(schema).some((field) => field.base === "string[]");
|
|
821
|
+
}
|
|
822
|
+
function arrayPositionsAreStale(config, storedGap) {
|
|
823
|
+
return storedGap !== ARRAY_POSITION_GAP && config.trackPositions !== false && holdsStringArrayField(config.schema);
|
|
824
|
+
}
|
|
825
|
+
function storedArrayPositionGap(value) {
|
|
826
|
+
return typeof value === "number" ? value : null;
|
|
827
|
+
}
|
|
828
|
+
|
|
817
829
|
// src/engine/recovery-schema.ts
|
|
818
830
|
function unflattenSchema(flat) {
|
|
819
831
|
const root = {};
|
|
@@ -993,11 +1005,12 @@ async function createIndexFromMetadata(deps, metadata, loadData) {
|
|
|
993
1005
|
documentCount: metadata.documentCount ?? 0,
|
|
994
1006
|
partitionCount: metadata.partitionCount,
|
|
995
1007
|
analysisRevision: metadata.analysisRevision ?? null,
|
|
1008
|
+
arrayPositionGap: metadata.arrayPositionGap ?? null,
|
|
996
1009
|
synonyms
|
|
997
1010
|
});
|
|
998
1011
|
if (loadData) await deps.indexState().registerOpen(metadata.indexName);
|
|
999
1012
|
else deps.indexState().registerClosed(metadata.indexName);
|
|
1000
|
-
if (metadata.analysisRevision !== language.revision) {
|
|
1013
|
+
if (metadata.analysisRevision !== language.revision || arrayPositionsAreStale(indexConfig, metadata.arrayPositionGap ?? null)) {
|
|
1001
1014
|
deps.analysisRebuild().markStale({
|
|
1002
1015
|
indexName: metadata.indexName,
|
|
1003
1016
|
language: language.name,
|
|
@@ -4051,7 +4064,7 @@ async function emitWriteEventAfter(source, indexName, write) {
|
|
|
4051
4064
|
// src/engine/core.ts
|
|
4052
4065
|
async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
4053
4066
|
validateWorkerConfig(config?.workers, config?.lifecycle);
|
|
4054
|
-
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-
|
|
4067
|
+
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-7MLQ7J64.mjs')).resolveRerankSettings(config);
|
|
4055
4068
|
const eventHandlers = eventHandlersOf(config?.events);
|
|
4056
4069
|
const vectorWorkerCount = splitWorkerBudget(resolveWorkerCount(config?.workers?.count)).vector;
|
|
4057
4070
|
const vectorCopyPolicy = {
|
|
@@ -4062,7 +4075,7 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
4062
4075
|
if (config?.lifecycle !== void 0 && durabilityTier === null) {
|
|
4063
4076
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index lifecycle settings require durability");
|
|
4064
4077
|
}
|
|
4065
|
-
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-
|
|
4078
|
+
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-S7OX2MAI.mjs');
|
|
4066
4079
|
const filesystemDurability = durabilityTier?.kind === "wal";
|
|
4067
4080
|
const executor = createDirectExecutor({
|
|
4068
4081
|
vectorWorkerCopies: vectorCopyPolicy,
|
|
@@ -4228,7 +4241,9 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
4228
4241
|
resyncIndex: (indexName, wasPromoted) => orchestrator.resyncIndex(indexName, wasPromoted),
|
|
4229
4242
|
recordCurrentAnalysis: (indexName) => {
|
|
4230
4243
|
const entry = indexRegistry.get(indexName);
|
|
4231
|
-
if (entry
|
|
4244
|
+
if (entry === void 0 || analysisRebuild.isStale(indexName)) return;
|
|
4245
|
+
entry.analysisRevision = entry.language.revision;
|
|
4246
|
+
entry.arrayPositionGap = ARRAY_POSITION_GAP;
|
|
4232
4247
|
},
|
|
4233
4248
|
durabilityManager: durability?.manager ?? null
|
|
4234
4249
|
});
|
|
@@ -4359,7 +4374,7 @@ async function shutdownEngine(core) {
|
|
|
4359
4374
|
}
|
|
4360
4375
|
}
|
|
4361
4376
|
if (core.rerankAdapters.size > 0) {
|
|
4362
|
-
await (await import('./runtime-
|
|
4377
|
+
await (await import('./runtime-7MLQ7J64.mjs')).shutdownRerankAdapters(core.rerankAdapters);
|
|
4363
4378
|
}
|
|
4364
4379
|
await orchestrator.shutdown();
|
|
4365
4380
|
await executor.shutdown();
|
|
@@ -4695,6 +4710,7 @@ function indexConfigurationOf(entry) {
|
|
|
4695
4710
|
entry.language,
|
|
4696
4711
|
entry.embeddingAdapterName,
|
|
4697
4712
|
entry.analysisRevision,
|
|
4713
|
+
entry.arrayPositionGap,
|
|
4698
4714
|
synonyms
|
|
4699
4715
|
);
|
|
4700
4716
|
}
|
|
@@ -4704,7 +4720,8 @@ function requireConfigurationWithinSizeLimit(config, language) {
|
|
|
4704
4720
|
config,
|
|
4705
4721
|
language,
|
|
4706
4722
|
typeof adapter === "string" ? adapter : null,
|
|
4707
|
-
language.revision
|
|
4723
|
+
language.revision,
|
|
4724
|
+
ARRAY_POSITION_GAP
|
|
4708
4725
|
);
|
|
4709
4726
|
if (messagePackUpperBoundBytes(payload) <= MAX_INDEX_CONFIGURATION_BYTES) return;
|
|
4710
4727
|
const bytes = encode(payload).byteLength;
|
|
@@ -4715,12 +4732,13 @@ function requireConfigurationWithinSizeLimit(config, language) {
|
|
|
4715
4732
|
{ bytes, maximum: MAX_INDEX_CONFIGURATION_BYTES }
|
|
4716
4733
|
);
|
|
4717
4734
|
}
|
|
4718
|
-
function configurationPayloadOf(config, language, adapterName, analysisRevision, synonyms) {
|
|
4735
|
+
function configurationPayloadOf(config, language, adapterName, analysisRevision, arrayPositionGap, synonyms) {
|
|
4719
4736
|
const bm25 = config.bm25;
|
|
4720
4737
|
return {
|
|
4721
4738
|
schema: config.schema,
|
|
4722
4739
|
language: language.name,
|
|
4723
4740
|
...analysisRevision !== null ? { analysisRevision } : {},
|
|
4741
|
+
...arrayPositionGap !== null ? { arrayPositionGap } : {},
|
|
4724
4742
|
...typeof config.tokenizer === "string" ? { tokenizer: config.tokenizer } : {},
|
|
4725
4743
|
...typeof config.stopWords === "string" ? { stopWords: config.stopWords } : {},
|
|
4726
4744
|
...config.stopWords instanceof Set ? { stopWordList: [...config.stopWords].sort(compareCodePoints) } : {},
|
|
@@ -4897,6 +4915,7 @@ async function createEngineIndex(core, config, name, requestedConfig, creation =
|
|
|
4897
4915
|
documentCount: 0,
|
|
4898
4916
|
partitionCount: indexConfig.partitions?.maxPartitions ?? 1,
|
|
4899
4917
|
analysisRevision: language.revision,
|
|
4918
|
+
arrayPositionGap: ARRAY_POSITION_GAP,
|
|
4900
4919
|
synonyms: synonyms?.encoded ?? null
|
|
4901
4920
|
});
|
|
4902
4921
|
await core.indexState.registerOpen(name);
|
|
@@ -7037,14 +7056,14 @@ function portabilityOperations(core, config, engine) {
|
|
|
7037
7056
|
return {
|
|
7038
7057
|
snapshot(indexName) {
|
|
7039
7058
|
return withOpenIndex2(indexName, async () => {
|
|
7040
|
-
const { createSnapshot } = await import('./snapshot-
|
|
7059
|
+
const { createSnapshot } = await import('./snapshot-DOQLGGEX.mjs');
|
|
7041
7060
|
return createSnapshot(snapshotDepsOf(indexName));
|
|
7042
7061
|
});
|
|
7043
7062
|
},
|
|
7044
7063
|
async restore(indexName, data) {
|
|
7045
7064
|
core.guardShutdown();
|
|
7046
7065
|
validateIndexName(indexName);
|
|
7047
|
-
const restored = import('./restore-queue-
|
|
7066
|
+
const restored = import('./restore-queue-JAMNRC6T.mjs').then(
|
|
7048
7067
|
({ queueRestore }) => queueRestore(core, restoreHost, restoresInFlight, indexName, data)
|
|
7049
7068
|
);
|
|
7050
7069
|
await emitWriteEventAfter(core, indexName, restored);
|
|
@@ -7053,8 +7072,8 @@ function portabilityOperations(core, config, engine) {
|
|
|
7053
7072
|
exportDocuments(indexName) {
|
|
7054
7073
|
return withOpenIndex2(indexName, async () => {
|
|
7055
7074
|
const [{ checkpointForArchive }, { documentExportStream }] = await Promise.all([
|
|
7056
|
-
import('./snapshot-
|
|
7057
|
-
import('./write-
|
|
7075
|
+
import('./snapshot-DOQLGGEX.mjs'),
|
|
7076
|
+
import('./write-ZKR7SNRT.mjs')
|
|
7058
7077
|
]);
|
|
7059
7078
|
const header = indexConfigurationOf(core.requireIndex(indexName));
|
|
7060
7079
|
return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
|
|
@@ -7081,6 +7100,12 @@ async function readUnderOneAnalysis(core, indexName, read) {
|
|
|
7081
7100
|
}
|
|
7082
7101
|
return { result, analysisStale };
|
|
7083
7102
|
}
|
|
7103
|
+
function phraseReadinessOf(core, indexName, config) {
|
|
7104
|
+
return () => {
|
|
7105
|
+
if (!core.analysisRebuild.isStale(indexName) || !holdsStringArrayField(config.schema)) return;
|
|
7106
|
+
requireLoadedPhraseCode().refusePhraseUntilRebuilt(indexName, core.analysisRebuild.rebuildMode);
|
|
7107
|
+
};
|
|
7108
|
+
}
|
|
7084
7109
|
function scopedParams(params, options) {
|
|
7085
7110
|
if (options?.globalStats === void 0) {
|
|
7086
7111
|
return params;
|
|
@@ -7106,7 +7131,7 @@ async function runEngineQuery(core, indexName, params, options) {
|
|
|
7106
7131
|
const manager = core.requireManager(indexName);
|
|
7107
7132
|
const scoped = scopedParams(params, options);
|
|
7108
7133
|
await core.pluginRegistry.runHook("beforeSearch", { indexName, params: scoped });
|
|
7109
|
-
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-
|
|
7134
|
+
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-7MLQ7J64.mjs');
|
|
7110
7135
|
const resolvedParams = await resolveVectorText(
|
|
7111
7136
|
rerank === void 0 ? scoped : rerank.withRerankQueryText(scoped),
|
|
7112
7137
|
entry.embeddingAdapter,
|
|
@@ -7126,7 +7151,8 @@ async function runEngineQuery(core, indexName, params, options) {
|
|
|
7126
7151
|
indexBm25: options?.indexBm25,
|
|
7127
7152
|
cursorBinding: lazyQueryBinding(params),
|
|
7128
7153
|
patternWorkCap: core.patternWorkCap,
|
|
7129
|
-
rerank: rerank?.rerankRunnerFor(core)
|
|
7154
|
+
rerank: rerank?.rerankRunnerFor(core),
|
|
7155
|
+
requirePhraseReady: phraseReadinessOf(core, indexName, entry.config)
|
|
7130
7156
|
};
|
|
7131
7157
|
const { result, analysisStale } = await readUnderOneAnalysis(
|
|
7132
7158
|
core,
|
|
@@ -7175,7 +7201,8 @@ async function runEnginePreflight(core, indexName, params, options) {
|
|
|
7175
7201
|
partitionIds: options?.partitionIds,
|
|
7176
7202
|
indexBm25: options?.indexBm25,
|
|
7177
7203
|
cursorBinding: lazyQueryBinding(params),
|
|
7178
|
-
patternWorkCap: core.patternWorkCap
|
|
7204
|
+
patternWorkCap: core.patternWorkCap,
|
|
7205
|
+
requirePhraseReady: phraseReadinessOf(core, indexName, entry.config)
|
|
7179
7206
|
};
|
|
7180
7207
|
const { result, analysisStale } = await readUnderOneAnalysis(
|
|
7181
7208
|
core,
|
|
@@ -7215,6 +7242,8 @@ async function runEngineQueryStats(core, indexName, terms, partitionIds, scope)
|
|
|
7215
7242
|
const entry = core.requireIndex(indexName);
|
|
7216
7243
|
const manager = core.requireManager(indexName);
|
|
7217
7244
|
const term = terms.join(" ");
|
|
7245
|
+
const loadingPhraseCode = loadPhraseCodeFor(term);
|
|
7246
|
+
if (loadingPhraseCode !== null) await loadingPhraseCode;
|
|
7218
7247
|
const analysis = {
|
|
7219
7248
|
stopWords: manager.analysis.stopWords,
|
|
7220
7249
|
customTokenizer: manager.analysis.customTokenizer,
|
|
@@ -7567,4 +7596,4 @@ async function createNarsil(config) {
|
|
|
7567
7596
|
// src/index.ts
|
|
7568
7597
|
var VERSION = "0.1.0";
|
|
7569
7598
|
|
|
7570
|
-
export { BYTES_TAG, DATE_TAG, DOCUMENT_EXPORT_FORMAT, DOCUMENT_EXPORT_VERSION, HEADER_SIZE, MILLISECONDS_PER_SECOND, NANOSECONDS_PER_MILLISECOND, NUMBER_TAG, OBJECT_TAG, VERSION, applyStoredIndexBm25, crc322 as crc32, crc32Final, crc32Init, crc32Update, createByteReader, createEngineCore, createEngineIndex, createNarsil, createNarsilFromCore, decodeIndexConfiguration, emptySerializablePartition, encodeBase64, encodeIndexConfiguration, engineVersionParts, hasNrslMagic, insertDocumentVectors, openChecksummedEnvelope, packChecksummedEnvelope, prepareConfiguredSynonyms, prepareDocumentVectors, prepareStoredSynonyms, readHeader, reconstructSchemaFromMetadata, removeDocumentVectors, requireConfigurationWithinSizeLimit, requireKnownConfig, resolveRunnableConfig, rulesOfStoredSynonyms, runEngineListDocuments, runEnginePreflight, runEngineQuery, runEngineQueryStats, runEngineSuggest, startEngineCore, startsWithTagPrefix, validateEmbeddingConfig, validateRequiredFieldsInSchema, writeHeader, yieldToEventLoop };
|
|
7599
|
+
export { BYTES_TAG, DATE_TAG, DOCUMENT_EXPORT_FORMAT, DOCUMENT_EXPORT_VERSION, HEADER_SIZE, MILLISECONDS_PER_SECOND, NANOSECONDS_PER_MILLISECOND, NUMBER_TAG, OBJECT_TAG, VERSION, applyStoredIndexBm25, arrayPositionsAreStale, crc322 as crc32, crc32Final, crc32Init, crc32Update, createByteReader, createEngineCore, createEngineIndex, createNarsil, createNarsilFromCore, decodeIndexConfiguration, emptySerializablePartition, encodeBase64, encodeIndexConfiguration, engineVersionParts, hasNrslMagic, insertDocumentVectors, openChecksummedEnvelope, packChecksummedEnvelope, prepareConfiguredSynonyms, prepareDocumentVectors, prepareStoredSynonyms, readHeader, reconstructSchemaFromMetadata, removeDocumentVectors, requireConfigurationWithinSizeLimit, requireKnownConfig, resolveRunnableConfig, rulesOfStoredSynonyms, runEngineListDocuments, runEnginePreflight, runEngineQuery, runEngineQueryStats, runEngineSuggest, startEngineCore, startsWithTagPrefix, storedArrayPositionGap, validateEmbeddingConfig, validateRequiredFieldsInSchema, writeHeader, yieldToEventLoop };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { vectorsPerFile } from './chunk-
|
|
2
|
-
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-
|
|
3
|
-
import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-
|
|
4
|
-
import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-
|
|
5
|
-
import { HEADER_SIZE } from './chunk-
|
|
1
|
+
import { vectorsPerFile } from './chunk-SOHMMNCH.mjs';
|
|
2
|
+
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-K77FJXKS.mjs';
|
|
3
|
+
import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-Y2U5VVWX.mjs';
|
|
4
|
+
import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-2JWNJSNE.mjs';
|
|
5
|
+
import { HEADER_SIZE } from './chunk-TGHNXN7W.mjs';
|
|
6
6
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
8
8
|
|
|
9
9
|
// src/persistence/archive/memory-store.ts
|
|
10
10
|
function joined(chunks) {
|
|
@@ -2,11 +2,11 @@ import { stopUsingTheNativeSearchCore, noteFallback, nativeSearchCoreIsEnabled }
|
|
|
2
2
|
import { unpackLevels, readTrailer, stageQueryLevels, osqCodeBytes, osqStagedQueryBytes, osqRecordBytes, writeRecord } from './chunk-37CD3OKS.mjs';
|
|
3
3
|
import { markSimdUnavailable } from './chunk-KOKM4PQN.mjs';
|
|
4
4
|
import { MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, OSQ_STEPS, OSQ_GRID, VECTOR_BLOCK_INITIAL_SLOTS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_PLACEMENT_QUERY_BITS, GRAPH_LOCK_WAIT_SLICE_MS, OSQ_QUERY_BITS, NATIVE_ATTACH_RETRY_MS, GRAPH_LOCK_WAIT_DEADLINE_MS, OSQ_LAMBDA, MAX_DOC_ID_TABLE_BYTES } from './chunk-QSK35UC2.mjs';
|
|
5
|
-
import { loadNativeCore } from './chunk-
|
|
5
|
+
import { loadNativeCore } from './chunk-2C3WXBQS.mjs';
|
|
6
6
|
import { COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, PLACEMENT_ROOM_REQUESTS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, DEFAULT_EF_SEARCH, NEAREST_LINK_FALLBACK_HOSTS, FARTHEST_REJECTED_LINKS_KEPT } from './chunk-VJS4JFBQ.mjs';
|
|
7
7
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
8
8
|
import { threadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
9
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
9
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
10
10
|
|
|
11
11
|
// src/vector/shared-buffers/growable.ts
|
|
12
12
|
function sharedMemoryAvailable() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { readRecentMemoryFigures, readMemoryFigures, answerRefusalOf } from './chunk-
|
|
1
|
+
import { readRecentMemoryFigures, readMemoryFigures, answerRefusalOf } from './chunk-4GDLFDPZ.mjs';
|
|
2
2
|
import { collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, reservedHeapBytes, admitHeapBytes } from './chunk-IWVEG5CX.mjs';
|
|
3
3
|
import { nativeSearchCoreIsEnabled } from './chunk-DJHHF2L5.mjs';
|
|
4
4
|
import { DEFAULT_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
|
|
5
|
-
import { loadNativeCore } from './chunk-
|
|
5
|
+
import { loadNativeCore } from './chunk-2C3WXBQS.mjs';
|
|
6
6
|
import { MAX_FILTER_DEPTH } from './chunk-WQBCBKY3.mjs';
|
|
7
|
-
import { MAX_SORT_FIELDS } from './chunk-
|
|
7
|
+
import { MAX_SORT_FIELDS } from './chunk-FQBFZAWG.mjs';
|
|
8
8
|
import { HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-22YPZVMG.mjs';
|
|
9
|
-
import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-
|
|
9
|
+
import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
10
10
|
import { randomUUID } from 'crypto';
|
|
11
11
|
import { mkdtemp, open, rm } from 'fs/promises';
|
|
12
12
|
import { tmpdir } from 'os';
|
|
@@ -181,6 +181,8 @@ var STATUS_BY_CODE = {
|
|
|
181
181
|
SEARCH_INVALID_CURSOR: 400,
|
|
182
182
|
SEARCH_RESULT_WINDOW_EXCEEDED: 400,
|
|
183
183
|
SEARCH_WORK_CAP_EXCEEDED: 400,
|
|
184
|
+
SEARCH_INVALID_PHRASE: 400,
|
|
185
|
+
SEARCH_PHRASE_NOT_READY: 503,
|
|
184
186
|
LANGUAGE_NOT_SUPPORTED: 400,
|
|
185
187
|
CONFIG_INVALID: 400,
|
|
186
188
|
EMBEDDING_DIMENSION_MISMATCH: 400,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { osqRecordBytes } from './chunk-37CD3OKS.mjs';
|
|
2
2
|
import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-VJS4JFBQ.mjs';
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/vector/vector-index/dead-bits.ts
|
|
6
6
|
var NO_LIVE_VECTOR_AT_POSITION = -1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, BLOCK_MAX_BYTES, sharedVectorStoreBytes, STORE_SLOTS, STORE_LIVE_COUNT, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, openGraphState, fixedView, createSharedVectorStoreHandles, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, growBufferTo, createOrdinalFilter, addToOrdinalFilter, slotByteOffset, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, grownByteLength, createVectorBlock, ensureBlockSlots, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes } from './chunk-
|
|
1
|
+
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, BLOCK_MAX_BYTES, sharedVectorStoreBytes, STORE_SLOTS, STORE_LIVE_COUNT, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, openGraphState, fixedView, createSharedVectorStoreHandles, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, growBufferTo, createOrdinalFilter, addToOrdinalFilter, slotByteOffset, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, grownByteLength, createVectorBlock, ensureBlockSlots, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes } from './chunk-X5CNUKD5.mjs';
|
|
2
2
|
import { MAX_VECTOR_ORDINALS } from './chunk-QSK35UC2.mjs';
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
4
4
|
import { readSync, closeSync, openSync } from 'fs';
|
|
5
5
|
|
|
6
6
|
function createVectorFileReader() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-
|
|
2
|
-
import { ServerErrorCodes } from './chunk-
|
|
1
|
+
import { sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-XABMCBHA.mjs';
|
|
2
|
+
import { ServerErrorCodes } from './chunk-CZ7ISLXA.mjs';
|
|
3
3
|
import { rm } from 'fs/promises';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-
|
|
2
|
-
import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, g as ListResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, Q as QueryParams, e as QueryResult, P as PreflightResult, h as SuggestParams, j as SuggestResult } from './events-
|
|
1
|
+
import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-CS-clLun.js';
|
|
2
|
+
import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, g as ListResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, Q as QueryParams, e as QueryResult, P as PreflightResult, h as SuggestParams, j as SuggestResult } from './events-DErop1LM.js';
|
|
3
3
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
4
|
-
import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-
|
|
4
|
+
import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-BfF-VRhm.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* This is the `fetch` implementation the client sends every request through.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './events-
|
|
2
|
-
export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-
|
|
3
|
-
export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-
|
|
4
|
-
export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-
|
|
5
|
-
import './schema-
|
|
1
|
+
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './events-DErop1LM.js';
|
|
2
|
+
export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-Bl8G9taj.js';
|
|
3
|
+
export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-BfF-VRhm.js';
|
|
4
|
+
export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-Cx-TiqPE.js';
|
|
5
|
+
import './schema-CS-clLun.js';
|
|
6
6
|
import './adapters-BQFQ4PRz.js';
|
|
7
7
|
import './synonyms-CpOAHPa-.js';
|
|
8
|
-
import './config-
|
|
9
|
-
import './config-
|
|
10
|
-
import './index-
|
|
8
|
+
import './config-CzB9YvF_.js';
|
|
9
|
+
import './config-hOWGBeC6.js';
|
|
10
|
+
import './index-CKI1fDEl.js';
|
|
11
11
|
import './types-DvncmvuQ.js';
|
package/dist/client.mjs
CHANGED
|
@@ -32,6 +32,8 @@ var ErrorCodes = {
|
|
|
32
32
|
SEARCH_INVALID_CURSOR: "SEARCH_INVALID_CURSOR",
|
|
33
33
|
SEARCH_RESULT_WINDOW_EXCEEDED: "SEARCH_RESULT_WINDOW_EXCEEDED",
|
|
34
34
|
SEARCH_WORK_CAP_EXCEEDED: "SEARCH_WORK_CAP_EXCEEDED",
|
|
35
|
+
SEARCH_INVALID_PHRASE: "SEARCH_INVALID_PHRASE",
|
|
36
|
+
SEARCH_PHRASE_NOT_READY: "SEARCH_PHRASE_NOT_READY",
|
|
35
37
|
BM25_NOT_READY: "BM25_NOT_READY",
|
|
36
38
|
LANGUAGE_NOT_SUPPORTED: "LANGUAGE_NOT_SUPPORTED",
|
|
37
39
|
ENVELOPE_VERSION_MISMATCH: "ENVELOPE_VERSION_MISMATCH",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NarsilConfig } from './config-
|
|
2
|
-
import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-
|
|
1
|
+
import { N as NarsilConfig } from './config-hOWGBeC6.js';
|
|
2
|
+
import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-CKI1fDEl.js';
|
|
3
3
|
import { N as NodeTransport } from './types-DvncmvuQ.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
2
|
-
import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './events-
|
|
3
|
-
import { I as IndexConfig, A as AnyDocument } from './schema-
|
|
2
|
+
import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './events-DErop1LM.js';
|
|
3
|
+
import { I as IndexConfig, A as AnyDocument } from './schema-CS-clLun.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Hooks that the engine calls alongside its own work, so that an application
|
|
@@ -229,9 +229,11 @@ interface NarsilConfig {
|
|
|
229
229
|
*/
|
|
230
230
|
events?: NarsilEventHandlers;
|
|
231
231
|
/**
|
|
232
|
-
* This is the most work that the engine may do on the pattern tests
|
|
233
|
-
* search, counted over every partition that it searches.
|
|
234
|
-
*
|
|
232
|
+
* This is the most work that the engine may do on the pattern tests and
|
|
233
|
+
* phrases of one search, counted over every partition that it searches. For
|
|
234
|
+
* a phrase, the engine adds one unit for each posting of its starting word
|
|
235
|
+
* that it visits, and one for each position that it compares. For a pattern
|
|
236
|
+
* test, it adds one unit for each run of three code points that it looks up in a pattern
|
|
235
237
|
* index, one for each entry that it reads from a pattern index, and one for
|
|
236
238
|
* each step of its matcher. For a text whose case fold is shorter than three
|
|
237
239
|
* code points, it counts each document that it checks as an entry that it
|