@delali/narsil 0.4.6-next.332 → 0.4.6-next.334
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/browser/{chunk-VAPCFSMX.mjs → chunk-3PGIOK7Z.mjs} +16 -1
- package/dist/browser/{chunk-VIVG3OXM.mjs → chunk-FBDTHGDR.mjs} +7 -3
- package/dist/browser/{chunk-56UNHLAF.mjs → chunk-HIC42RBU.mjs} +1 -1
- package/dist/browser/{chunk-DJDBJB2U.mjs → chunk-J343PP7Q.mjs} +85 -28
- package/dist/browser/{optional-reads-NQO5DKM4.mjs → optional-reads-4O4CJ7TR.mjs} +1 -1
- package/dist/browser/{optional-writes-3HKIVZFU.mjs → optional-writes-OFPF77WY.mjs} +2 -1
- package/dist/browser/{runtime-OMKE7DF4.mjs → runtime-AMEB4J2D.mjs} +2 -1
- package/dist/browser/{segment-codec-leaf-GXSRX5VT.mjs → segment-codec-leaf-E4YHXUAI.mjs} +7 -2
- package/dist/browser/{storage-leaf-72PEG6IP.mjs → storage-leaf-WJMD66YX.mjs} +15 -2
- package/dist/{capabilities-DaJKuKlG.d.ts → capabilities-YazdElfW.d.ts} +2 -2
- package/dist/{chunk-UAITBI74.mjs → chunk-2QQCR7KF.mjs} +15 -9
- package/dist/{chunk-NNRDQYBD.mjs → chunk-4QNWK42S.mjs} +104 -41
- package/dist/{chunk-G6P6YTTW.mjs → chunk-5PUNOJC7.mjs} +1 -1
- package/dist/chunk-6S5QPDPP.mjs +110 -0
- package/dist/{chunk-EY5U4P5V.mjs → chunk-7NMLFP2T.mjs} +17 -2
- package/dist/{react-native/chunks/chunk-NUOJ2EAK.mjs → chunk-AKLCYPUY.mjs} +1 -1
- package/dist/{chunk-WRDGPEN6.mjs → chunk-B276ZQIH.mjs} +2 -2
- package/dist/{chunk-HWIIMLLR.mjs → chunk-B6VO3BCX.mjs} +6 -6
- package/dist/{chunk-3GWUUKDJ.mjs → chunk-BVFJ5XAU.mjs} +2 -2
- package/dist/{chunk-WCGFMFWK.mjs → chunk-CHGJGKST.mjs} +2 -2
- package/dist/{chunk-AQI4DIFA.mjs → chunk-CVCBVUH4.mjs} +2 -2
- package/dist/{chunk-CN42TL6V.mjs → chunk-HB3EBTKC.mjs} +5 -5
- package/dist/{react-native/chunks/chunk-ALSPAMEE.mjs → chunk-HNE4HNC2.mjs} +2 -2
- package/dist/{chunk-RBHEMWN6.mjs → chunk-I255IQTR.mjs} +3 -3
- package/dist/{chunk-VIHHCXBO.mjs → chunk-IALJ2X74.mjs} +3 -3
- package/dist/{chunk-EDZJNZKV.mjs → chunk-ICEZRKIS.mjs} +1 -1
- package/dist/{chunk-JXRMHWQU.mjs → chunk-IVVNKTHC.mjs} +1 -1
- package/dist/{chunk-MUBQER6D.mjs → chunk-KHZ6LAFB.mjs} +1 -1
- package/dist/{chunk-5SHWA6PE.mjs → chunk-L2GYY6KY.mjs} +1 -1
- package/dist/{chunk-4JLHHEBN.mjs → chunk-M5RYB6FE.mjs} +1 -1
- package/dist/{chunk-ONDHZ4WW.mjs → chunk-N3DJTTKK.mjs} +2 -2
- package/dist/{chunk-JASE2FE6.mjs → chunk-QWYIMVYT.mjs} +2 -2
- package/dist/{chunk-GTB2S2VX.mjs → chunk-R5OFJZNI.mjs} +2 -2
- package/dist/{chunk-7DW2ITZ3.mjs → chunk-RHFUQ76T.mjs} +1 -1
- package/dist/{chunk-FWZ5OK5G.mjs → chunk-SCUYG24W.mjs} +4 -4
- package/dist/{chunk-DVFCDOXW.mjs → chunk-TNBOFWDS.mjs} +1 -1
- package/dist/{chunk-PM2UOKYB.mjs → chunk-UFDD57KD.mjs} +37 -9
- package/dist/{chunk-M2Z5WVWW.mjs → chunk-UGMOBSMD.mjs} +2 -0
- package/dist/{chunk-CZHAPGVH.mjs → chunk-UJQ2S5QU.mjs} +80 -78
- package/dist/{chunk-43T3P3BE.mjs → chunk-WW3RDS57.mjs} +1 -1
- package/dist/{chunk-BOTZ2GSW.mjs → chunk-Z622PLNH.mjs} +25 -14
- package/dist/{client-DetSCqP2.d.ts → client-B9YNYYs_.d.ts} +38 -12
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +2 -2
- package/dist/{config-BB4MRAsB.d.ts → config-DJFXyHMZ.d.ts} +2 -2
- package/dist/{config-XEHd4MFx.d.ts → config-DlvP2PSi.d.ts} +2 -2
- package/dist/{direct-executor-3C5WFR33.mjs → direct-executor-P2Z7T57F.mjs} +3 -3
- 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/transport/tcp.mjs +1 -1
- package/dist/distribution.d.ts +14 -9
- package/dist/distribution.mjs +391 -315
- package/dist/{engine-DGG_yX0p.d.ts → engine-DP4PrdKM.d.ts} +51 -13
- package/dist/{index-fX_FbuRT.d.ts → index-CcivYH_R.d.ts} +1 -1
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +3 -3
- package/dist/index.react-native.mjs +3 -3
- package/dist/{long-query-thread-C62WK6NI.mjs → long-query-thread-SOJ25FZU.mjs} +13 -13
- package/dist/{msgpack-leaf-LIT7TKZW.mjs → msgpack-leaf-LTAJ5QGB.mjs} +2 -2
- package/dist/{optional-reads-ESDVS225.mjs → optional-reads-5QWIOFOU.mjs} +1 -1
- package/dist/{optional-writes-AGDEVXC4.mjs → optional-writes-GVHTEENI.mjs} +5 -5
- package/dist/{paged-partition-archive-EABR3N3F.mjs → paged-partition-archive-XCETVLZW.mjs} +13 -13
- package/dist/partial-words.browser.mjs +3 -3
- package/dist/partial-words.mjs +3 -3
- package/dist/pattern.browser.mjs +2 -2
- package/dist/pattern.mjs +2 -2
- package/dist/persistence/durability/checkpoint-worker.d.ts +2 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +10 -10
- package/dist/{query-actions-QH5UQRCY.mjs → query-actions-WKC4SQEZ.mjs} +3 -3
- package/dist/query-suggestions/merge-worker.mjs +6 -6
- package/dist/query-suggestions.browser.mjs +3 -3
- package/dist/query-suggestions.d.ts +2 -2
- package/dist/query-suggestions.mjs +4 -4
- package/dist/react-native/chunks/{chunk-PTCHRZCP.mjs → chunk-4JY2CZWV.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-ESVBC3AT.mjs → chunk-BIORJHQZ.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-AOLLV37A.mjs → chunk-CBG4EUYD.mjs} +17 -2
- package/dist/react-native/chunks/{chunk-GPMPHDDO.mjs → chunk-FN3HBVNY.mjs} +2 -2
- package/dist/{chunk-AWMO3NKJ.mjs → react-native/chunks/chunk-LR6OK725.mjs} +1 -1
- package/dist/{chunk-57MN2UAL.mjs → react-native/chunks/chunk-MPNHORPY.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-V2H7EDTM.mjs → chunk-QT2G6OMI.mjs} +103 -40
- package/dist/react-native/chunks/{chunk-BGRX5SPG.mjs → chunk-QZUFYRFX.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-ZF3VSGEI.mjs → chunk-ZSJABTIE.mjs} +1 -1
- package/dist/react-native/chunks/{msgpack-leaf-FOUPTT7J.mjs → msgpack-leaf-Q4BPA4G7.mjs} +2 -2
- package/dist/react-native/chunks/{optional-reads-TN3PT6M4.mjs → optional-reads-M6F26KFO.mjs} +1 -1
- package/dist/react-native/chunks/{optional-writes-F4FJKEZ4.mjs → optional-writes-TCVHZRRM.mjs} +4 -4
- package/dist/react-native/chunks/{restore-queue-MLFBOOZP.mjs → restore-queue-RLQ3L223.mjs} +6 -6
- package/dist/{runtime-USQYKN3I.mjs → react-native/chunks/runtime-7UKADH3G.mjs} +2 -1
- package/dist/react-native/chunks/{segment-codec-leaf-Z3OS3B2K.mjs → segment-codec-leaf-IM6YCP7M.mjs} +4 -4
- package/dist/react-native/chunks/{segment-merge-leaf-TNHU77VW.mjs → segment-merge-leaf-32YR2ZTM.mjs} +5 -5
- package/dist/react-native/chunks/{storage-leaf-NF733K7B.mjs → storage-leaf-RKI6S6T5.mjs} +23 -10
- package/dist/react-native/chunks/{store-leaf-UDKCNQB7.mjs → store-leaf-YQXG6NOD.mjs} +5 -5
- package/dist/react-native/chunks/{suggestions-leaf-M6ITOPNM.mjs → suggestions-leaf-Q3ABULFB.mjs} +5 -5
- package/dist/react-native/chunks/{worker-copies-GG7CKUBI.mjs → worker-copies-W63KWZZN.mjs} +4 -4
- package/dist/react-native/partial-words.mjs +3 -3
- package/dist/react-native/pattern.mjs +2 -2
- package/dist/react-native/query-suggestions.mjs +3 -3
- package/dist/react-native/sync.mjs +12 -7
- package/dist/react-native/synonyms.mjs +3 -3
- package/dist/react.d.ts +9 -9
- package/dist/{rerank-LCMA5PZG.mjs → rerank-OJLSVUYV.mjs} +25 -12
- package/dist/{restore-queue-NSA3RWF6.mjs → restore-queue-BYO4AJLZ.mjs} +6 -6
- package/dist/{react-native/chunks/runtime-UOHD2XUJ.mjs → runtime-WWFVQOBJ.mjs} +2 -1
- package/dist/{schema-CFnQ-WI3.d.ts → schema-CPQUdJTs.d.ts} +6 -0
- package/dist/{segment-codec-leaf-DQKKIN4F.mjs → segment-codec-leaf-V52PQEVL.mjs} +4 -4
- package/dist/{segment-merge-leaf-67Z6OMRF.mjs → segment-merge-leaf-M3ZLJYDD.mjs} +4 -4
- package/dist/server.d.ts +22 -11
- package/dist/server.mjs +23 -21
- package/dist/{storage-leaf-FUH75D3X.mjs → storage-leaf-YYO4FLHQ.mjs} +22 -22
- package/dist/{store-leaf-CKZFFFTX.mjs → store-leaf-KK7VD3P3.mjs} +5 -5
- package/dist/{suggestions-leaf-NOSJIRSD.mjs → suggestions-leaf-EJCNU3NM.mjs} +7 -7
- package/dist/sync/filesystem.d.ts +3 -3
- package/dist/sync/filesystem.mjs +8 -8
- package/dist/sync/indexeddb.browser.mjs +1 -1
- package/dist/sync/indexeddb.d.ts +3 -3
- package/dist/sync/indexeddb.mjs +2 -2
- package/dist/sync.browser.mjs +7 -6
- package/dist/sync.d.ts +4 -4
- package/dist/sync.mjs +12 -7
- package/dist/synonyms.browser.mjs +3 -3
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-Bpi5YNZF.d.ts → tasks-4rvZJuoN.d.ts} +8 -4
- package/dist/{thread-T5F3HSMC.mjs → thread-6BVFFMP7.mjs} +12 -12
- package/dist/{types-DGjk684l.d.ts → types-C3hkFf_3.d.ts} +2 -2
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/{worker-copies-TPEHVXPI.mjs → worker-copies-5V5JGCWU.mjs} +6 -6
- package/dist/workers/entry.mjs +9 -9
- package/openapi.json +58 -2
- package/package.json +5 -5
|
@@ -1039,6 +1039,21 @@ function partialFieldsOf(schema) {
|
|
|
1039
1039
|
partialFieldsBySchema.set(schema, frozen);
|
|
1040
1040
|
return frozen;
|
|
1041
1041
|
}
|
|
1042
|
+
var vectorPathsBySchema = /* @__PURE__ */ new WeakMap();
|
|
1043
|
+
function vectorFieldSegmentsOf(schema) {
|
|
1044
|
+
const cached = vectorPathsBySchema.get(schema);
|
|
1045
|
+
if (cached !== void 0) return cached;
|
|
1046
|
+
const paths = [];
|
|
1047
|
+
for (const field of schemaFieldsOf(schema)) {
|
|
1048
|
+
if (field.base !== "vector") continue;
|
|
1049
|
+
const segments = field.path.split(".");
|
|
1050
|
+
Object.freeze(segments);
|
|
1051
|
+
paths.push(segments);
|
|
1052
|
+
}
|
|
1053
|
+
const frozen = Object.freeze(paths);
|
|
1054
|
+
vectorPathsBySchema.set(schema, frozen);
|
|
1055
|
+
return frozen;
|
|
1056
|
+
}
|
|
1042
1057
|
function extractVectorFieldsFromSchema(schema) {
|
|
1043
1058
|
const result = /* @__PURE__ */ new Map();
|
|
1044
1059
|
for (const field of schemaFieldsOf(schema)) {
|
|
@@ -1236,4 +1251,4 @@ function requireLoadedMessagePack() {
|
|
|
1236
1251
|
return loaded;
|
|
1237
1252
|
}
|
|
1238
1253
|
|
|
1239
|
-
export { ANTIMERIDIAN_SPAN_DEGREES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER, CHECKSUM_YIELD_CHUNK_BYTES, COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, ClientErrorCodes, DEFAULT_EF_SEARCH, DEG_TO_RAD, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH, EARLIER_RELEASE_MIN_M, EARTH_RADIUS_METERS, ErrorCodes, FARTHEST_REJECTED_LINKS_KEPT, FULL_TURN_DEGREES, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, LOCATION_CELLS_PER_AXIS, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_DOCUMENT_ENCODING_DEPTH, MAX_DOCUMENT_NESTING_DEPTH, MAX_FILE_BYTES, MAX_LATITUDE_DEGREES, MAX_LAYER_CAP, MAX_LONGITUDE_DEGREES, MAX_M, MAX_NESTING_DEPTH, MAX_PATTERN_VALUE_LIMIT, MIN_M, MIN_PATTERN_VALUE_LIMIT, MIN_POLYGON_POINTS, NATIVE_CRC32_MIN_BYTES, NEAREST_LINK_FALLBACK_HOSTS, NarsilError, PLACEMENT_ROOM_REQUESTS, PROTOTYPE_POLLUTION_KEYS, SORT_MODES, SORT_VALUE_MAX_CODE_POINTS, ServerErrorCodes, VALID_HNSW_METRICS, VECTOR_PATTERN, codePointCount, compareCodePoints, createNarsilError, defaultSortMode, describeError, exceedsCodePoints, extractVectorFieldsFromSchema, flattenSchema, getFlatSchema, getNestedValue, getOrCreateFieldNameIndex, holdsUnpairedSurrogate, isGeopointOrVectorType, isLatitude, isListBase, isLongitude, isNarsilError, isPlainObject, isQuantizationMode, isSingleStringFieldType, isSortMode, isStorageMode, isStringValuedBase, isWordIndexedBase, isWordIndexedFieldType, loadMessagePack, loadedMessagePack, messagePackUpperBoundBytes, parseVectorDimension, parsedTypeOf, partialFieldsOf, raiseEarlierReleaseGraphSetting, requireCreatableSchema, requireDocumentWithinSizeLimit, requireLoadedMessagePack, requireValidFieldTypes, schemaFieldsOf, sortModeOf, textFieldsChanged, toComparableSortValue, tokenizeOptions, truncateSortString, validateDocument, validateDocumentStrict, validateRequiredFields, validateSchema, validateTextStorage, validateVectorPromotion, validateVectorStorage, vectorDimensionOf, withSortableOption, withUnpairedSurrogatesReplaced };
|
|
1254
|
+
export { ANTIMERIDIAN_SPAN_DEGREES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER, CHECKSUM_YIELD_CHUNK_BYTES, COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, ClientErrorCodes, DEFAULT_EF_SEARCH, DEG_TO_RAD, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH, EARLIER_RELEASE_MIN_M, EARTH_RADIUS_METERS, ErrorCodes, FARTHEST_REJECTED_LINKS_KEPT, FULL_TURN_DEGREES, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, LOCATION_CELLS_PER_AXIS, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_DOCUMENT_ENCODING_DEPTH, MAX_DOCUMENT_NESTING_DEPTH, MAX_FILE_BYTES, MAX_LATITUDE_DEGREES, MAX_LAYER_CAP, MAX_LONGITUDE_DEGREES, MAX_M, MAX_NESTING_DEPTH, MAX_PATTERN_VALUE_LIMIT, MIN_M, MIN_PATTERN_VALUE_LIMIT, MIN_POLYGON_POINTS, NATIVE_CRC32_MIN_BYTES, NEAREST_LINK_FALLBACK_HOSTS, NarsilError, PLACEMENT_ROOM_REQUESTS, PROTOTYPE_POLLUTION_KEYS, SORT_MODES, SORT_VALUE_MAX_CODE_POINTS, ServerErrorCodes, VALID_HNSW_METRICS, VECTOR_PATTERN, codePointCount, compareCodePoints, createNarsilError, defaultSortMode, describeError, exceedsCodePoints, extractVectorFieldsFromSchema, flattenSchema, getFlatSchema, getNestedValue, getOrCreateFieldNameIndex, holdsUnpairedSurrogate, isGeopointOrVectorType, isLatitude, isListBase, isLongitude, isNarsilError, isPlainObject, isQuantizationMode, isSingleStringFieldType, isSortMode, isStorageMode, isStringValuedBase, isWordIndexedBase, isWordIndexedFieldType, loadMessagePack, loadedMessagePack, messagePackUpperBoundBytes, parseVectorDimension, parsedTypeOf, partialFieldsOf, raiseEarlierReleaseGraphSetting, requireCreatableSchema, requireDocumentWithinSizeLimit, requireLoadedMessagePack, requireValidFieldTypes, schemaFieldsOf, sortModeOf, textFieldsChanged, toComparableSortValue, tokenizeOptions, truncateSortString, validateDocument, validateDocumentStrict, validateRequiredFields, validateSchema, validateTextStorage, validateVectorPromotion, validateVectorStorage, vectorDimensionOf, vectorFieldSegmentsOf, withSortableOption, withUnpairedSurrogatesReplaced };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NarsilError, ErrorCodes, loadMessagePack, ClientErrorCodes, ServerErrorCodes, describeError } from './chunk-
|
|
1
|
+
import { NarsilError, ErrorCodes, loadMessagePack, ClientErrorCodes, ServerErrorCodes, describeError } from './chunk-3PGIOK7Z.mjs';
|
|
2
2
|
|
|
3
3
|
// src/json-encoding.ts
|
|
4
4
|
function toPlainNumbers(key, value) {
|
|
@@ -290,7 +290,7 @@ function createBulkOperations(transport) {
|
|
|
290
290
|
const payload = await transport.json({
|
|
291
291
|
method: "POST",
|
|
292
292
|
path,
|
|
293
|
-
body: encodeJson({ docIds }),
|
|
293
|
+
body: encodeJson(options?.document === void 0 ? { docIds } : { docIds, document: options.document }),
|
|
294
294
|
contentType: "application/json",
|
|
295
295
|
repeatable: true,
|
|
296
296
|
options
|
|
@@ -701,7 +701,11 @@ function createDocumentOperations(transport) {
|
|
|
701
701
|
},
|
|
702
702
|
async get(indexName, docId, options) {
|
|
703
703
|
const path = documentPath(indexName, docId);
|
|
704
|
-
const
|
|
704
|
+
const vectors = options?.vectors;
|
|
705
|
+
const payload = await transport.jsonOrNull(
|
|
706
|
+
{ method: "GET", path, query: { vectors: vectors === void 0 ? void 0 : String(vectors) }, options },
|
|
707
|
+
ErrorCodes.DOC_NOT_FOUND
|
|
708
|
+
);
|
|
705
709
|
if (payload === null) return void 0;
|
|
706
710
|
return readObject(payload, "document", path);
|
|
707
711
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NarsilError, ErrorCodes, requireLoadedMessagePack, getNestedValue, parsedTypeOf } from './chunk-
|
|
1
|
+
import { NarsilError, ErrorCodes, requireLoadedMessagePack, getNestedValue, parsedTypeOf } from './chunk-3PGIOK7Z.mjs';
|
|
2
2
|
|
|
3
3
|
// src/core/stored-values/build.ts
|
|
4
4
|
var ORDINAL_LIMIT = 4294967295;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, storedText, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, discardStoredValues, bitsetIsEmpty, storedValuesOf, bitsetHas, createBitSet, bitsetSet, storedValueBytes, prepareStoredValues, cachedStoredFields, bitsetClear, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, buildStoredValues, bitsetAndNotInto, bitsetAndInto, bitsetOrInto, checkedSize, fuzzyPrefixOf, boundedLevenshtein, installStoredFields, FILTER_OPERAND_COPY_DEPTH, fuzzyTermMatches, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES, bitsetIterator, GrowableUint32, bitsetFromSet } from './chunk-
|
|
1
|
+
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, storedText, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, discardStoredValues, bitsetIsEmpty, storedValuesOf, bitsetHas, createBitSet, bitsetSet, storedValueBytes, prepareStoredValues, cachedStoredFields, bitsetClear, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, buildStoredValues, bitsetAndNotInto, bitsetAndInto, bitsetOrInto, checkedSize, fuzzyPrefixOf, boundedLevenshtein, installStoredFields, FILTER_OPERAND_COPY_DEPTH, fuzzyTermMatches, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES, bitsetIterator, GrowableUint32, bitsetFromSet } from './chunk-HIC42RBU.mjs';
|
|
2
2
|
import { newSyncEpoch, isSyncEpoch } from './chunk-YJHGOJAC.mjs';
|
|
3
|
-
import { parsedTypeOf, NarsilError, ErrorCodes, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, createNarsilError, withUnpairedSurrogatesReplaced, tokenizeOptions, getNestedValue, isPlainObject, MAX_NESTING_DEPTH, loadMessagePack, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, extractVectorFieldsFromSchema, loadedMessagePack, flattenSchema, vectorDimensionOf, isSingleStringFieldType, schemaFieldsOf, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isStringValuedBase, compareCodePoints, isWordIndexedFieldType, messagePackUpperBoundBytes, toComparableSortValue, exceedsCodePoints, SORT_VALUE_MAX_CODE_POINTS, PROTOTYPE_POLLUTION_KEYS, sortModeOf, defaultSortMode, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, getOrCreateFieldNameIndex, isWordIndexedBase, holdsUnpairedSurrogate, validateRequiredFields, requireDocumentWithinSizeLimit, isNarsilError, PLACEMENT_ROOM_REQUESTS, NEAREST_LINK_FALLBACK_HOSTS, MIN_M, MAX_M, MAX_LAYER_CAP, MAX_FILE_BYTES, INITIAL_UPPER_SLOTS, INITIAL_LIST_CAPACITY, FARTHEST_REJECTED_LINKS_KEPT, EARLIER_RELEASE_MIN_M, DEFAULT_EF_SEARCH, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, CONNECT_RESTARTS_BEFORE_ONE_PASS, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, requireValidFieldTypes, parseVectorDimension, isStorageMode, isQuantizationMode, VALID_HNSW_METRICS, MAX_DOCUMENT_NESTING_DEPTH, NATIVE_CRC32_MIN_BYTES, CHECKSUM_YIELD_CHUNK_BYTES, raiseEarlierReleaseGraphSetting, MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER, withSortableOption, VECTOR_PATTERN, isListBase, isGeopointOrVectorType, MAX_COVERING_CELLS, LOCATION_CODE_BITS_PER_AXIS, LOCATION_CELLS_PER_AXIS, FULL_TURN_DEGREES, EARTH_RADIUS_METERS, DEG_TO_RAD, ANTIMERIDIAN_SPAN_DEGREES, truncateSortString, SORT_MODES, isSortMode, codePointCount } from './chunk-
|
|
3
|
+
import { parsedTypeOf, NarsilError, ErrorCodes, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, createNarsilError, withUnpairedSurrogatesReplaced, tokenizeOptions, getNestedValue, isPlainObject, MAX_NESTING_DEPTH, loadMessagePack, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, extractVectorFieldsFromSchema, loadedMessagePack, flattenSchema, vectorDimensionOf, isSingleStringFieldType, schemaFieldsOf, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isStringValuedBase, compareCodePoints, isWordIndexedFieldType, messagePackUpperBoundBytes, toComparableSortValue, exceedsCodePoints, vectorFieldSegmentsOf, SORT_VALUE_MAX_CODE_POINTS, PROTOTYPE_POLLUTION_KEYS, sortModeOf, defaultSortMode, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, getOrCreateFieldNameIndex, isWordIndexedBase, holdsUnpairedSurrogate, validateRequiredFields, requireDocumentWithinSizeLimit, isNarsilError, PLACEMENT_ROOM_REQUESTS, NEAREST_LINK_FALLBACK_HOSTS, MIN_M, MAX_M, MAX_LAYER_CAP, MAX_FILE_BYTES, INITIAL_UPPER_SLOTS, INITIAL_LIST_CAPACITY, FARTHEST_REJECTED_LINKS_KEPT, EARLIER_RELEASE_MIN_M, DEFAULT_EF_SEARCH, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, CONNECT_RESTARTS_BEFORE_ONE_PASS, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, requireValidFieldTypes, parseVectorDimension, isStorageMode, isQuantizationMode, VALID_HNSW_METRICS, MAX_DOCUMENT_NESTING_DEPTH, NATIVE_CRC32_MIN_BYTES, CHECKSUM_YIELD_CHUNK_BYTES, raiseEarlierReleaseGraphSetting, MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER, withSortableOption, VECTOR_PATTERN, isListBase, isGeopointOrVectorType, MAX_COVERING_CELLS, LOCATION_CODE_BITS_PER_AXIS, LOCATION_CELLS_PER_AXIS, FULL_TURN_DEGREES, EARTH_RADIUS_METERS, DEG_TO_RAD, ANTIMERIDIAN_SPAN_DEGREES, truncateSortString, SORT_MODES, isSortMode, codePointCount } from './chunk-3PGIOK7Z.mjs';
|
|
4
4
|
|
|
5
5
|
// src/analysis/registry.ts
|
|
6
6
|
var tokenizers = /* @__PURE__ */ new Map();
|
|
@@ -2398,6 +2398,8 @@ function copyStoredValue(value) {
|
|
|
2398
2398
|
}
|
|
2399
2399
|
|
|
2400
2400
|
// src/core/projection.ts
|
|
2401
|
+
var EVERY_FIELD = Object.freeze({ kind: "full" });
|
|
2402
|
+
var NO_FIELD = Object.freeze({ kind: "none" });
|
|
2401
2403
|
function requireFieldPathList(paths, option) {
|
|
2402
2404
|
if (paths === void 0) return;
|
|
2403
2405
|
if (!Array.isArray(paths)) {
|
|
@@ -2417,13 +2419,14 @@ function requireFieldPathList(paths, option) {
|
|
|
2417
2419
|
);
|
|
2418
2420
|
}
|
|
2419
2421
|
}
|
|
2420
|
-
function splitPaths(paths) {
|
|
2422
|
+
function splitPaths(paths, vectorFields) {
|
|
2421
2423
|
if (!paths) return [];
|
|
2422
2424
|
const split = [];
|
|
2423
2425
|
for (const path of paths) {
|
|
2424
2426
|
const segments2 = path.split(".").filter((segment) => segment.length > 0);
|
|
2425
2427
|
if (segments2.length === 0) continue;
|
|
2426
2428
|
if (segments2.some((segment) => PROTOTYPE_POLLUTION_KEYS.has(segment))) continue;
|
|
2429
|
+
if (vectorFields.some((field) => field.length < segments2.length && covers(field, segments2))) continue;
|
|
2427
2430
|
split.push(segments2);
|
|
2428
2431
|
}
|
|
2429
2432
|
return split;
|
|
@@ -2486,20 +2489,50 @@ function cloneExcept(value, path, exclude) {
|
|
|
2486
2489
|
}
|
|
2487
2490
|
return kept;
|
|
2488
2491
|
}
|
|
2489
|
-
function
|
|
2490
|
-
if (
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
if (
|
|
2498
|
-
return
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2492
|
+
function requireVectorsSwitch(vectors) {
|
|
2493
|
+
if (vectors === void 0 || typeof vectors === "boolean") return;
|
|
2494
|
+
throw new NarsilError(ErrorCodes.SEARCH_INVALID_FIELD, 'The "document.vectors" option takes true or false', {
|
|
2495
|
+
option: "document.vectors",
|
|
2496
|
+
received: vectors === null ? "null" : typeof vectors
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
function projectionFields(projection) {
|
|
2500
|
+
if (projection === void 0 || projection === null || projection === true) return void 0;
|
|
2501
|
+
if (typeof projection === "object" && !Array.isArray(projection)) return projection;
|
|
2502
|
+
throw new NarsilError(
|
|
2503
|
+
ErrorCodes.SEARCH_INVALID_FIELD,
|
|
2504
|
+
'The "document" option takes true, false, or an object of field path lists',
|
|
2505
|
+
{ option: "document", received: Array.isArray(projection) ? "array" : typeof projection }
|
|
2506
|
+
);
|
|
2507
|
+
}
|
|
2508
|
+
function samePath(a, b) {
|
|
2509
|
+
return a.length === b.length && covers(a, b);
|
|
2510
|
+
}
|
|
2511
|
+
function returnsVectorField(field, vectors, include, returnVectors) {
|
|
2512
|
+
if (vectors !== void 0) return vectors;
|
|
2513
|
+
if (include?.some((included) => samePath(included, field))) return true;
|
|
2514
|
+
return returnVectors;
|
|
2515
|
+
}
|
|
2516
|
+
function resolveProjection(projection, index) {
|
|
2517
|
+
if (projection === false) return NO_FIELD;
|
|
2518
|
+
const shaped = projectionFields(projection);
|
|
2519
|
+
if (shaped !== void 0) {
|
|
2520
|
+
requireFieldPathList(shaped.include, "include");
|
|
2521
|
+
requireFieldPathList(shaped.exclude, "exclude");
|
|
2522
|
+
requireVectorsSwitch(shaped.vectors);
|
|
2523
|
+
}
|
|
2524
|
+
const askedInclude = shaped !== void 0 && Array.isArray(shaped.include) && shaped.include.length > 0;
|
|
2525
|
+
const askedExclude = shaped !== void 0 && Array.isArray(shaped.exclude) && shaped.exclude.length > 0;
|
|
2526
|
+
const returnsEveryVector = shaped?.vectors ?? index.returnVectors === true;
|
|
2527
|
+
if (!askedInclude && !askedExclude && returnsEveryVector) return EVERY_FIELD;
|
|
2528
|
+
const vectorFields = vectorFieldSegmentsOf(index.schema);
|
|
2529
|
+
const include = askedInclude ? splitPaths(shaped.include, vectorFields) : null;
|
|
2530
|
+
const exclude = askedExclude ? splitPaths(shaped.exclude, vectorFields) : [];
|
|
2531
|
+
for (const field of vectorFields) {
|
|
2532
|
+
if (!returnsVectorField(field, shaped?.vectors, include, index.returnVectors === true)) exclude.push(field);
|
|
2533
|
+
}
|
|
2534
|
+
if (include === null && exclude.length === 0) return EVERY_FIELD;
|
|
2535
|
+
return { kind: "fields", include, exclude };
|
|
2503
2536
|
}
|
|
2504
2537
|
function projectionKeepsField(projection, fieldPath) {
|
|
2505
2538
|
if (projection.kind === "full") return true;
|
|
@@ -5322,6 +5355,16 @@ function validatePatternValueLimit(limit) {
|
|
|
5322
5355
|
);
|
|
5323
5356
|
}
|
|
5324
5357
|
}
|
|
5358
|
+
var BOOLEAN_ONLY_SETTINGS = ["returnVectors", "strict", "surfaceForms", "trackPositions"];
|
|
5359
|
+
function validateBooleanOnlySettings(config) {
|
|
5360
|
+
for (const setting of BOOLEAN_ONLY_SETTINGS) {
|
|
5361
|
+
const given = config[setting];
|
|
5362
|
+
if (given === void 0 || typeof given === "boolean") continue;
|
|
5363
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${setting} must be true or false`, {
|
|
5364
|
+
[setting]: given === null ? "null" : typeof given
|
|
5365
|
+
});
|
|
5366
|
+
}
|
|
5367
|
+
}
|
|
5325
5368
|
function requirePositiveSafeInteger(field, value) {
|
|
5326
5369
|
if (value === void 0) return;
|
|
5327
5370
|
if (!Number.isSafeInteger(value) || value < 1) {
|
|
@@ -12381,7 +12424,7 @@ function segmentsHostPart() {
|
|
|
12381
12424
|
|
|
12382
12425
|
// src/core/segment-codec-code.ts
|
|
12383
12426
|
var segmentCodec = codeLoader(async () => {
|
|
12384
|
-
const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-
|
|
12427
|
+
const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-E4YHXUAI.mjs')]);
|
|
12385
12428
|
code7.bindSegmentCodecHost(optionalCodeHost(), msgpack);
|
|
12386
12429
|
return code7;
|
|
12387
12430
|
}, "segment codec");
|
|
@@ -12389,7 +12432,7 @@ var loadSegmentCodec = segmentCodec.load;
|
|
|
12389
12432
|
|
|
12390
12433
|
// src/engine/optional-writes-code.ts
|
|
12391
12434
|
var optionalWrites = codeLoader(async () => {
|
|
12392
|
-
const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-
|
|
12435
|
+
const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-OFPF77WY.mjs')]);
|
|
12393
12436
|
code7.bindOptionalWritesHost(optionalCodeHost(), segmentCodec2);
|
|
12394
12437
|
return code7;
|
|
12395
12438
|
}, "write");
|
|
@@ -13950,6 +13993,7 @@ function configurationPayloadOf(config, language, adapterName, analysisRevision,
|
|
|
13950
13993
|
...config.trackPositions !== void 0 ? { trackPositions: config.trackPositions } : {},
|
|
13951
13994
|
...config.textStorage !== void 0 ? { textStorage: config.textStorage } : {},
|
|
13952
13995
|
...config.strict !== void 0 ? { strict: config.strict } : {},
|
|
13996
|
+
...config.returnVectors !== void 0 ? { returnVectors: config.returnVectors } : {},
|
|
13953
13997
|
...config.required !== void 0 ? { required: config.required } : {},
|
|
13954
13998
|
...config.vectorPromotion !== void 0 ? { vectorPromotion: config.vectorPromotion } : {},
|
|
13955
13999
|
...config.patternValueLimit !== void 0 ? { patternValueLimit: config.patternValueLimit } : {},
|
|
@@ -14025,6 +14069,7 @@ async function createEngineIndex(core2, config, name, requestedConfig, creation
|
|
|
14025
14069
|
requirePatternSearchFor(schema);
|
|
14026
14070
|
requirePartialWordSearchFor(schema);
|
|
14027
14071
|
validatePatternValueLimit(indexConfig.patternValueLimit);
|
|
14072
|
+
validateBooleanOnlySettings(indexConfig);
|
|
14028
14073
|
requireSurfaceFormsForPartialFields(schema, indexConfig.surfaceForms);
|
|
14029
14074
|
validateVectorPromotion(indexConfig.vectorPromotion);
|
|
14030
14075
|
validateVectorStorage(indexConfig.vectorPromotion, core2.filesystemDurability);
|
|
@@ -19238,7 +19283,7 @@ var storageCode = codeLoader(async () => {
|
|
|
19238
19283
|
loadSegmentMerge(),
|
|
19239
19284
|
loadSuggestionStore(),
|
|
19240
19285
|
loadVectorCore(),
|
|
19241
|
-
import('./storage-leaf-
|
|
19286
|
+
import('./storage-leaf-WJMD66YX.mjs')
|
|
19242
19287
|
]);
|
|
19243
19288
|
code7.bindStorageHost(optionalCodeHost(), digest2, msgpack, segmentCodec2, segmentMerge2, suggestionStore2, vectorCore2);
|
|
19244
19289
|
return code7;
|
|
@@ -19990,7 +20035,7 @@ var loaded2 = null;
|
|
|
19990
20035
|
var loading3 = null;
|
|
19991
20036
|
function importOptionalReads() {
|
|
19992
20037
|
if (loaded2 !== null) return Promise.resolve(loaded2);
|
|
19993
|
-
loading3 ??= import('./optional-reads-
|
|
20038
|
+
loading3 ??= import('./optional-reads-4O4CJ7TR.mjs').then(
|
|
19994
20039
|
(code7) => {
|
|
19995
20040
|
code7.bindOptionalReadsHost(optionalCodeHost());
|
|
19996
20041
|
loaded2 = code7;
|
|
@@ -20768,7 +20813,7 @@ function createDirectExecutor(options) {
|
|
|
20768
20813
|
}
|
|
20769
20814
|
case "get": {
|
|
20770
20815
|
const entry = requireIndex(action.indexName);
|
|
20771
|
-
return entry.manager.get(action.docId);
|
|
20816
|
+
return entry.manager.get(action.docId, action.projection);
|
|
20772
20817
|
}
|
|
20773
20818
|
case "has": {
|
|
20774
20819
|
const entry = requireIndex(action.indexName);
|
|
@@ -21629,7 +21674,7 @@ function checkHeapAfterRecovery(core2) {
|
|
|
21629
21674
|
var loaded3 = null;
|
|
21630
21675
|
function loadRerankRuntime() {
|
|
21631
21676
|
if (loaded3 !== null) return Promise.resolve(loaded3);
|
|
21632
|
-
return import('./runtime-
|
|
21677
|
+
return import('./runtime-AMEB4J2D.mjs').then((runtime) => {
|
|
21633
21678
|
runtime.bindRerankHost(optionalCodeHost());
|
|
21634
21679
|
loaded3 = runtime;
|
|
21635
21680
|
return runtime;
|
|
@@ -22769,7 +22814,7 @@ async function runQuery(request, callerContext, pin) {
|
|
|
22769
22814
|
offset,
|
|
22770
22815
|
sortFields,
|
|
22771
22816
|
sortSignature,
|
|
22772
|
-
projection: resolveProjection(params.document),
|
|
22817
|
+
projection: resolveProjection(params.document, config),
|
|
22773
22818
|
placesPinned: context.partitionIds === void 0
|
|
22774
22819
|
},
|
|
22775
22820
|
highlighting: {
|
|
@@ -23117,6 +23162,7 @@ async function runEngineListDocuments(core2, indexName, params, partitionIds) {
|
|
|
23117
23162
|
manager,
|
|
23118
23163
|
schema: entry.config.schema,
|
|
23119
23164
|
strict: entry.config.strict,
|
|
23165
|
+
returnVectors: entry.config.returnVectors,
|
|
23120
23166
|
partitionIds,
|
|
23121
23167
|
patternWorkCap: core2.patternWorkCap
|
|
23122
23168
|
})
|
|
@@ -23276,20 +23322,31 @@ function createNarsilFromCore(core2, config) {
|
|
|
23276
23322
|
requireIndex(indexName);
|
|
23277
23323
|
return orchestrator.awaitWrites(indexName);
|
|
23278
23324
|
},
|
|
23279
|
-
async get(indexName, docId) {
|
|
23280
|
-
return withOpenIndex2(
|
|
23325
|
+
async get(indexName, docId, options) {
|
|
23326
|
+
return withOpenIndex2(
|
|
23327
|
+
indexName,
|
|
23328
|
+
() => executor.execute({
|
|
23329
|
+
type: "get",
|
|
23330
|
+
indexName,
|
|
23331
|
+
docId,
|
|
23332
|
+
requestId: docId,
|
|
23333
|
+
projection: resolveProjection(options?.document, requireIndex(indexName).config)
|
|
23334
|
+
})
|
|
23335
|
+
);
|
|
23281
23336
|
},
|
|
23282
|
-
async getMultiple(indexName, docIds) {
|
|
23337
|
+
async getMultiple(indexName, docIds, options) {
|
|
23283
23338
|
guardShutdown();
|
|
23284
23339
|
requireIndex(indexName);
|
|
23285
23340
|
return withOpenIndex2(indexName, async () => {
|
|
23341
|
+
const projection = resolveProjection(options?.document, requireIndex(indexName).config);
|
|
23286
23342
|
const result = /* @__PURE__ */ new Map();
|
|
23287
23343
|
for (const docId of docIds) {
|
|
23288
23344
|
const doc = await executor.execute({
|
|
23289
23345
|
type: "get",
|
|
23290
23346
|
indexName,
|
|
23291
23347
|
docId,
|
|
23292
|
-
requestId: docId
|
|
23348
|
+
requestId: docId,
|
|
23349
|
+
projection
|
|
23293
23350
|
});
|
|
23294
23351
|
if (doc !== void 0) result.set(docId, doc);
|
|
23295
23352
|
}
|
|
@@ -3148,7 +3148,7 @@ function executeListDocuments(params, context) {
|
|
|
3148
3148
|
const signature = sortSignatureOf(params.sort);
|
|
3149
3149
|
requireSortableFields(params.sort, schema, context.strict === true);
|
|
3150
3150
|
const filters = validQueryFilter(params.filters, schema);
|
|
3151
|
-
const projection = resolveProjection(params.document);
|
|
3151
|
+
const projection = resolveProjection(params.document, context);
|
|
3152
3152
|
const binding = listBindingOf(params.filters);
|
|
3153
3153
|
let cursor = null;
|
|
3154
3154
|
if (params.cursor !== void 0) {
|
|
@@ -3428,7 +3428,8 @@ function prepareUpdatePartitionDoc(document, extractedVectors) {
|
|
|
3428
3428
|
}
|
|
3429
3429
|
const partitionDoc = structuredClone(source);
|
|
3430
3430
|
for (const [fieldPath, vector] of extractedVectors) {
|
|
3431
|
-
if (vector !== null || getNestedValue(partitionDoc, fieldPath)
|
|
3431
|
+
if (vector !== null || getNestedValue(partitionDoc, fieldPath) === void 0)
|
|
3432
|
+
deleteNestedValue(partitionDoc, fieldPath);
|
|
3432
3433
|
}
|
|
3433
3434
|
return { partitionDoc };
|
|
3434
3435
|
}
|
|
@@ -326,7 +326,7 @@ async function runRerankedQuery(request, io) {
|
|
|
326
326
|
const offset = host.clampRowCount(request.offset, DEFAULT_OFFSET);
|
|
327
327
|
const cursorDepth = request.searchAfter === void 0 ? 0 : rerankCursorDepth(request.searchAfter, io.binding, host);
|
|
328
328
|
const depth = firstStageDepth(hybridDepth, plan.window, cursorDepth, offset, limit);
|
|
329
|
-
const projection = host.resolveProjection(request.document);
|
|
329
|
+
const projection = host.resolveProjection(request.document, io);
|
|
330
330
|
const { rerank: _rerank, pinned: _pinned, searchAfter: _searchAfter, highlight: _highlight, ...firstParams } = request;
|
|
331
331
|
const placesPins = request.searchAfter === void 0 && request.pinned !== void 0;
|
|
332
332
|
const countsApart = placesPins || request.vector !== void 0 && !fuses;
|
|
@@ -404,6 +404,7 @@ async function executeRerankedQuery(request, context, firstStage, host) {
|
|
|
404
404
|
const result = await runRerankedQuery(request, {
|
|
405
405
|
host,
|
|
406
406
|
schema: context.config.schema,
|
|
407
|
+
returnVectors: context.config.returnVectors,
|
|
407
408
|
maxWindow: runner.maxWindow,
|
|
408
409
|
binding: context.cursorBinding,
|
|
409
410
|
clampsPins: true,
|
|
@@ -111,6 +111,9 @@ function reconstructSchemaFromMetadata(metadata) {
|
|
|
111
111
|
if (metadata.strict !== void 0) {
|
|
112
112
|
config.strict = metadata.strict;
|
|
113
113
|
}
|
|
114
|
+
if (metadata.returnVectors !== void 0) {
|
|
115
|
+
config.returnVectors = metadata.returnVectors;
|
|
116
|
+
}
|
|
114
117
|
if (metadata.required !== void 0) {
|
|
115
118
|
config.required = metadata.required;
|
|
116
119
|
}
|
|
@@ -249,6 +252,7 @@ async function rebuildTextIndexes(manager, hooks, target) {
|
|
|
249
252
|
|
|
250
253
|
// src/serialization/msgpack-without-fields.ts
|
|
251
254
|
var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
255
|
+
var MSGPACK_NIL = 192;
|
|
252
256
|
var keyDecoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
|
|
253
257
|
var walkedHeader = { headerBytes: 0, bodyBytes: 0, children: 0 };
|
|
254
258
|
function endOfValue(view, start) {
|
|
@@ -308,7 +312,7 @@ function decodeMapWithoutFields(bytes, skippedFields) {
|
|
|
308
312
|
if (key === null || FORBIDDEN_KEYS.has(key.key)) return null;
|
|
309
313
|
const valueEnd = endOfValue(view, key.end);
|
|
310
314
|
if (valueEnd === null) return null;
|
|
311
|
-
if (!skippedFields.has(key.key)) {
|
|
315
|
+
if (!skippedFields.has(key.key) || view.getUint8(key.end) === MSGPACK_NIL) {
|
|
312
316
|
try {
|
|
313
317
|
document[key.key] = decode(bytes.subarray(key.end, valueEnd));
|
|
314
318
|
} catch {
|
|
@@ -427,7 +431,8 @@ function removeFieldAtPath(document, fieldPath) {
|
|
|
427
431
|
if (next === null || typeof next !== "object" || Array.isArray(next)) return;
|
|
428
432
|
current = next;
|
|
429
433
|
}
|
|
430
|
-
|
|
434
|
+
const leaf = segments[segments.length - 1];
|
|
435
|
+
if (current[leaf] !== null) delete current[leaf];
|
|
431
436
|
}
|
|
432
437
|
function decodeStoredDocument(bytes, discardedFields) {
|
|
433
438
|
let decoded;
|
|
@@ -3484,6 +3484,7 @@ function readSharedConfigFields(source, reject) {
|
|
|
3484
3484
|
reject("textStorage must be 'memory' or 'disk'");
|
|
3485
3485
|
}
|
|
3486
3486
|
const strict = restoredBoolean(source.strict, "strict", reject);
|
|
3487
|
+
const returnVectors = restoredBoolean(source.returnVectors, "returnVectors", reject);
|
|
3487
3488
|
const required = restoredRequired(source.required, reject);
|
|
3488
3489
|
const vectorPromotion = restoredVectorPromotion(source.vectorPromotion, reject);
|
|
3489
3490
|
if (source.patternValueLimit !== void 0 && typeof source.patternValueLimit !== "number") {
|
|
@@ -3498,6 +3499,7 @@ function readSharedConfigFields(source, reject) {
|
|
|
3498
3499
|
...trackPositions !== void 0 ? { trackPositions } : {},
|
|
3499
3500
|
...textStorage === "memory" || textStorage === "disk" ? { textStorage } : {},
|
|
3500
3501
|
...strict !== void 0 ? { strict } : {},
|
|
3502
|
+
...returnVectors !== void 0 ? { returnVectors } : {},
|
|
3501
3503
|
...required !== void 0 ? { required } : {},
|
|
3502
3504
|
...vectorPromotion !== void 0 ? { vectorPromotion } : {},
|
|
3503
3505
|
...typeof source.patternValueLimit === "number" ? { patternValueLimit: source.patternValueLimit } : {}
|
|
@@ -11743,6 +11745,9 @@ function metadataFromConfig(indexName, config, partitionCount, documentCount, sa
|
|
|
11743
11745
|
if (config.strict !== void 0) {
|
|
11744
11746
|
metadata.strict = config.strict;
|
|
11745
11747
|
}
|
|
11748
|
+
if (config.returnVectors !== void 0) {
|
|
11749
|
+
metadata.returnVectors = config.returnVectors;
|
|
11750
|
+
}
|
|
11746
11751
|
if (config.required !== void 0) {
|
|
11747
11752
|
metadata.required = config.required;
|
|
11748
11753
|
}
|
|
@@ -11798,6 +11803,7 @@ function metadataConfigOf(entry) {
|
|
|
11798
11803
|
...entry.config.trackPositions !== void 0 ? { trackPositions: entry.config.trackPositions } : {},
|
|
11799
11804
|
...entry.config.textStorage !== void 0 ? { textStorage: entry.config.textStorage } : {},
|
|
11800
11805
|
...entry.config.strict !== void 0 ? { strict: entry.config.strict } : {},
|
|
11806
|
+
...entry.config.returnVectors !== void 0 ? { returnVectors: entry.config.returnVectors } : {},
|
|
11801
11807
|
...entry.config.required !== void 0 ? { required: entry.config.required } : {},
|
|
11802
11808
|
...entry.config.vectorPromotion !== void 0 ? { vectorPromotion: entry.config.vectorPromotion } : {},
|
|
11803
11809
|
...entry.config.patternValueLimit !== void 0 ? { patternValueLimit: entry.config.patternValueLimit } : {},
|
|
@@ -12343,6 +12349,9 @@ function metadataToWire(meta) {
|
|
|
12343
12349
|
if (meta.strict !== void 0) {
|
|
12344
12350
|
wire.strict = meta.strict;
|
|
12345
12351
|
}
|
|
12352
|
+
if (meta.returnVectors !== void 0) {
|
|
12353
|
+
wire.return_vectors = meta.returnVectors;
|
|
12354
|
+
}
|
|
12346
12355
|
if (meta.required !== void 0) {
|
|
12347
12356
|
wire.required = meta.required;
|
|
12348
12357
|
}
|
|
@@ -12469,6 +12478,9 @@ function wireToMetadata(raw) {
|
|
|
12469
12478
|
if (typeof raw.strict === "boolean") {
|
|
12470
12479
|
meta.strict = raw.strict;
|
|
12471
12480
|
}
|
|
12481
|
+
if (typeof raw.return_vectors === "boolean") {
|
|
12482
|
+
meta.returnVectors = raw.return_vectors;
|
|
12483
|
+
}
|
|
12472
12484
|
if (Array.isArray(raw.required) && raw.required.every((field) => typeof field === "string")) {
|
|
12473
12485
|
meta.required = raw.required;
|
|
12474
12486
|
}
|
|
@@ -12585,7 +12597,7 @@ function dropStoredVectorValues(documents, schema) {
|
|
|
12585
12597
|
}
|
|
12586
12598
|
function removeFieldAtPath(fields, fieldPath) {
|
|
12587
12599
|
if (!fieldPath.includes(".")) {
|
|
12588
|
-
delete fields[fieldPath];
|
|
12600
|
+
if (fields[fieldPath] !== null) delete fields[fieldPath];
|
|
12589
12601
|
return;
|
|
12590
12602
|
}
|
|
12591
12603
|
const segments = fieldPath.split(".");
|
|
@@ -12597,7 +12609,8 @@ function removeFieldAtPath(fields, fieldPath) {
|
|
|
12597
12609
|
}
|
|
12598
12610
|
current = next;
|
|
12599
12611
|
}
|
|
12600
|
-
|
|
12612
|
+
const leaf = segments[segments.length - 1];
|
|
12613
|
+
if (current[leaf] !== null) delete current[leaf];
|
|
12601
12614
|
}
|
|
12602
12615
|
|
|
12603
12616
|
// src/serialization/payload-v1/partition.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-8LcdNB77.js';
|
|
2
|
-
import { C as ClusterNamespace } from './config-
|
|
2
|
+
import { C as ClusterNamespace } from './config-DlvP2PSi.js';
|
|
3
3
|
import { l as RecordedQuery } from './query-suggestions-CBYkrQ5T.js';
|
|
4
|
-
import { E as ErrorDetail, j as TaskStore } from './tasks-
|
|
4
|
+
import { E as ErrorDetail, j as TaskStore } from './tasks-4rvZJuoN.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The settings of the device sync routes, `GET /indexes/{name}/sync/snapshot`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { responseStopOf, sendRelayed, readQueryBody, withServerQueryLimits, requestSignal, respondJson, encodeQueryResult, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerFeedRoute, SYNC_FEED_ROUTE, CHANGES_FEED_ROUTE, registerServerRoutes, closeWhenTheProcessExits, acknowledgeThreadClose, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, LeavingResponse, refuseAndClose, serverRoutes, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, threadCloseRequested, departureConfirmed, serverCloseDeadline, REQUEST_THREAD_DRAIN_DEADLINE_MS, departureConfirmation, serverCloseSignalled, stopResponse, parseJsonObject, validateSuggest, rejectInvalid, isMainFeedNote, SEARCH_CLOCK_SAMPLE_UNITS, REQUEST_THREAD_DEPARTURE_DRAIN_MS, awaitDepartureConfirmation } from './chunk-
|
|
1
|
+
import { responseStopOf, sendRelayed, readQueryBody, withServerQueryLimits, requestSignal, respondJson, encodeQueryResult, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerFeedRoute, SYNC_FEED_ROUTE, CHANGES_FEED_ROUTE, registerServerRoutes, closeWhenTheProcessExits, acknowledgeThreadClose, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, LeavingResponse, refuseAndClose, serverRoutes, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, threadCloseRequested, departureConfirmed, serverCloseDeadline, REQUEST_THREAD_DRAIN_DEADLINE_MS, departureConfirmation, serverCloseSignalled, stopResponse, parseJsonObject, validateSuggest, rejectInvalid, isMainFeedNote, SEARCH_CLOCK_SAMPLE_UNITS, REQUEST_THREAD_DEPARTURE_DRAIN_MS, awaitDepartureConfirmation } from './chunk-UFDD57KD.mjs';
|
|
2
2
|
import { SYNC_CLOSE_GOING_AWAY } from './chunk-TACP6VK6.mjs';
|
|
3
|
-
import { importOptionalReads, loadSortingFor, holdsQuotedText, loadQueryCode, executeQuery, lazyQueryBinding, executePreflight, resolveProjection, projectionKeepsField, loadRerankRuntime, setNestedValue } from './chunk-
|
|
4
|
-
import { loadedMessagePack, loadMessagePack, extractVectorFieldsFromSchema } from './chunk-
|
|
3
|
+
import { importOptionalReads, loadSortingFor, holdsQuotedText, loadQueryCode, executeQuery, lazyQueryBinding, executePreflight, resolveProjection, projectionKeepsField, loadRerankRuntime, setNestedValue } from './chunk-4QNWK42S.mjs';
|
|
4
|
+
import { loadedMessagePack, loadMessagePack, extractVectorFieldsFromSchema } from './chunk-7NMLFP2T.mjs';
|
|
5
5
|
import { answerFromOneState } from './chunk-PSZEGK6W.mjs';
|
|
6
6
|
import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-ZKOQR7EA.mjs';
|
|
7
7
|
|
|
@@ -526,7 +526,7 @@ function createThreadReadEngine(options) {
|
|
|
526
526
|
}
|
|
527
527
|
function holdsEveryVectorFieldRead(indexName, context, params) {
|
|
528
528
|
if (params.document === false) return true;
|
|
529
|
-
const projection = resolveProjection(params.document
|
|
529
|
+
const projection = resolveProjection(params.document, context.config);
|
|
530
530
|
return vectorFieldsOf(context).every(
|
|
531
531
|
(fieldPath) => !projectionKeepsField(projection, fieldPath) || executor.holdsVectorField(indexName, fieldPath)
|
|
532
532
|
);
|
|
@@ -701,14 +701,19 @@ function createThreadReadEngine(options) {
|
|
|
701
701
|
return result;
|
|
702
702
|
});
|
|
703
703
|
},
|
|
704
|
-
async get(indexName, docId) {
|
|
705
|
-
return readCopy(
|
|
704
|
+
async get(indexName, docId, options2) {
|
|
705
|
+
return readCopy(
|
|
706
|
+
indexName,
|
|
707
|
+
true,
|
|
708
|
+
(manager, context) => manager.get(docId, resolveProjection(options2?.document, context.config))
|
|
709
|
+
);
|
|
706
710
|
},
|
|
707
|
-
async getMultiple(indexName, docIds) {
|
|
708
|
-
return readCopy(indexName, true, (manager) => {
|
|
711
|
+
async getMultiple(indexName, docIds, options2) {
|
|
712
|
+
return readCopy(indexName, true, (manager, context) => {
|
|
713
|
+
const projection = resolveProjection(options2?.document, context.config);
|
|
709
714
|
const found = /* @__PURE__ */ new Map();
|
|
710
715
|
for (const docId of docIds) {
|
|
711
|
-
const document = manager.get(docId);
|
|
716
|
+
const document = manager.get(docId, projection);
|
|
712
717
|
if (document !== void 0) found.set(docId, document);
|
|
713
718
|
}
|
|
714
719
|
return found;
|
|
@@ -732,6 +737,7 @@ function createThreadReadEngine(options) {
|
|
|
732
737
|
manager,
|
|
733
738
|
schema: context.config.schema,
|
|
734
739
|
strict: context.config.strict,
|
|
740
|
+
returnVectors: context.config.returnVectors,
|
|
735
741
|
patternWorkCap
|
|
736
742
|
})
|
|
737
743
|
);
|