@delali/narsil 0.3.1-next.70 → 0.3.1-next.72
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/{capabilities-Dt-7B4Wz.d.ts → capabilities-D6gjjQyA.d.ts} +2 -2
- package/dist/{chunk-P4DSQ6M4.mjs → chunk-2X2ZQOAB.mjs} +69 -28
- package/dist/chunk-3HQPUCCT.mjs +785 -0
- package/dist/{chunk-VNMTB3KC.mjs → chunk-7QMTA7AA.mjs} +194 -59
- package/dist/{chunk-FVLQ63B7.mjs → chunk-CVPA5Q7R.mjs} +24 -3
- package/dist/{chunk-2STVUTNA.mjs → chunk-EDMCZLSJ.mjs} +4 -3
- package/dist/{chunk-M76V3OGJ.mjs → chunk-HVJYTKK7.mjs} +940 -647
- package/dist/{chunk-HWQLTLNG.mjs → chunk-KZTI25D3.mjs} +1 -1
- package/dist/{chunk-YJDQ7NLA.mjs → chunk-LCCL6EEH.mjs} +3 -3
- package/dist/{chunk-OI42GWLR.mjs → chunk-LJYTW7GT.mjs} +57 -11
- package/dist/{chunk-653BNMAF.mjs → chunk-M6XF5HDE.mjs} +57 -17
- package/dist/{chunk-YNVIUGF5.mjs → chunk-P2ZZN32C.mjs} +1 -1
- package/dist/{chunk-LMO5TJUS.mjs → chunk-QR4OKRVY.mjs} +637 -196
- package/dist/{chunk-USKFU7J5.mjs → chunk-RV77FR2F.mjs} +1 -0
- package/dist/{chunk-GIVAGD3Q.mjs → chunk-XZ4PAREY.mjs} +1 -1
- package/dist/{chunk-3JGWULDF.mjs → chunk-Y52WZWAU.mjs} +5 -5
- package/dist/chunk-ZKRV5M2P.mjs +75 -0
- package/dist/{client-COek5GXK.d.ts → client-C2TiW29y.d.ts} +3 -3
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +1 -0
- package/dist/{config-rBpbgTw8.d.ts → config-BLguB-om.d.ts} +2 -2
- package/dist/{config-Dfanyqqt.d.ts → config-C7Ip8Ife.d.ts} +17 -2
- package/dist/direct-executor-SVCHXR74.mjs +14 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +2 -2
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +1 -1
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +58 -35
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-CXKfmK7I.d.ts → engine-Dm4446j1.d.ts} +104 -62
- package/dist/index.browser.mjs +2222 -1100
- package/dist/index.d.ts +27 -8
- package/dist/index.mjs +14 -12
- package/dist/invalidation/filesystem.mjs +1 -1
- package/dist/{memory-C7UMCMH3.d.ts → memory-CKHTU1CL.d.ts} +66 -25
- package/dist/pattern-Cledccbl.d.ts +18 -0
- package/dist/pattern.d.ts +22 -0
- package/dist/pattern.mjs +7 -0
- package/dist/persistence/durability/checkpoint-worker.d.ts +17 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +14 -12
- package/dist/react.d.ts +277 -182
- package/dist/react.mjs +190 -45
- package/dist/{schema-Bgzr4g7b.d.ts → schema-BBOCdhND.d.ts} +9 -7
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +13 -12
- package/dist/{tasks-BZt_zes6.d.ts → tasks-BECd0b__.d.ts} +1 -1
- package/dist/{thread-JEVAYETR.mjs → thread-IBSIZZ6W.mjs} +22 -13
- package/dist/{types-gOUqhs2F.d.ts → types-BiUmaiWT.d.ts} +1 -1
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +4 -4
- package/dist/workers/entry.mjs +4 -4
- package/package.json +15 -7
- package/dist/direct-executor-GYJEKNV5.mjs +0 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { b as StopWordOverride, C as CustomTokenizer } from './schema-
|
|
2
|
-
export { A as AnyDocument, B as BM25Params, E as EmbeddingFieldConfig, F as FieldOptionChain, c as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, d as ScoringMode, T as TextFieldOption, V as VectorIndexConfig, e as VectorQuantizationMode, f as VectorStorageMode, W as WriteOptions } from './schema-
|
|
1
|
+
import { b as StopWordOverride, C as CustomTokenizer } from './schema-BBOCdhND.js';
|
|
2
|
+
export { A as AnyDocument, B as BM25Params, E as EmbeddingFieldConfig, F as FieldOptionChain, c as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, d as ScoringMode, T as TextFieldOption, V as VectorIndexConfig, e as VectorQuantizationMode, f as VectorStorageMode, W as WriteOptions } from './schema-BBOCdhND.js';
|
|
3
|
+
import { P as PatternSearch } from './pattern-Cledccbl.js';
|
|
3
4
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
4
5
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
5
|
-
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, l as ComparisonFilter, D as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, m as FacetResult, n as FieldFilter, o as FilterExpression, G as GeoFilter, p as GeoPolygonFilter, q as GeoRadiusFilter, r as GroupConfig, s as GroupReducer, t as GroupResult, H as HighlightConfig, u as HighlightMatch, v as Hit, w as HybridConfig, I as IndexInfo, f as IndexStats, L as ListParams, g as ListResult, x as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, P as PartitionStatsResult, h as PreflightResult, y as PresenceFilter, z as ProcessMemoryReport, J as QueryCoverage, Q as QueryParams, e as QueryResult, K as ScoreComponents, O as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, R as SortField, T as SortSpec, U as StringFilter, j as SuggestParams, k as SuggestResult, W as TermMatchPolicy, V as VectorMaintenanceResult, X as VectorQueryConfig, Y as WorkerCopyReport, i as isNarsilError } from './memory-
|
|
6
|
-
import { N as NarsilConfig } from './config-
|
|
7
|
-
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-
|
|
8
|
-
import { a as Narsil } from './engine-
|
|
9
|
-
export { D as DocumentWriteOperations, I as IndexLifecycleOperations, N as NarsilEventMap } from './engine-
|
|
6
|
+
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, l as ComparisonFilter, D as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, m as FacetResult, n as FieldFilter, o as FilterExpression, G as GeoFilter, p as GeoPolygonFilter, q as GeoRadiusFilter, r as GroupConfig, s as GroupReducer, t as GroupResult, H as HighlightConfig, u as HighlightMatch, v as Hit, w as HybridConfig, I as IndexInfo, f as IndexStats, L as ListParams, g as ListResult, x as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, P as PartitionStatsResult, h as PreflightResult, y as PresenceFilter, z as ProcessMemoryReport, J as QueryCoverage, Q as QueryParams, e as QueryResult, K as ScoreComponents, O as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, R as SortField, T as SortSpec, U as StringFilter, j as SuggestParams, k as SuggestResult, W as TermMatchPolicy, V as VectorMaintenanceResult, X as VectorQueryConfig, Y as WorkerCopyReport, i as isNarsilError } from './memory-CKHTU1CL.js';
|
|
7
|
+
import { N as NarsilConfig } from './config-C7Ip8Ife.js';
|
|
8
|
+
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-C7Ip8Ife.js';
|
|
9
|
+
import { a as Narsil } from './engine-Dm4446j1.js';
|
|
10
|
+
export { D as DocumentWriteOperations, I as IndexLifecycleOperations, N as NarsilEventMap } from './engine-Dm4446j1.js';
|
|
10
11
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter } from './adapters-79OIa4xm.js';
|
|
11
12
|
export { i as isSimdAvailable } from './simd-DW5AtJ6B.js';
|
|
12
13
|
|
|
@@ -81,6 +82,24 @@ declare function getTokenizer(name: string): CustomTokenizer;
|
|
|
81
82
|
*/
|
|
82
83
|
declare function getStopWords(name: string): StopWordOverride;
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* This makes pattern search available to every index whose schema declares a
|
|
87
|
+
* pattern field, meaning a `verbatim` field or a text field whose type
|
|
88
|
+
* includes `pattern`.
|
|
89
|
+
*
|
|
90
|
+
* A Node process needs no such call, because it loads the pattern search code
|
|
91
|
+
* by itself. A browser app has to import `patternSearch` from
|
|
92
|
+
* `@delali/narsil/pattern` and pass it to this function before it creates or
|
|
93
|
+
* loads an index with a pattern field.
|
|
94
|
+
*
|
|
95
|
+
* @param module - The `patternSearch` object that `@delali/narsil/pattern`
|
|
96
|
+
* exports.
|
|
97
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` for any other object.
|
|
98
|
+
*
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
declare function registerPatternSearch(module: PatternSearch): void;
|
|
102
|
+
|
|
84
103
|
/**
|
|
85
104
|
* Sets how many normalised tokens the engine keeps cached.
|
|
86
105
|
*
|
|
@@ -178,4 +197,4 @@ declare function createNarsil(config?: NarsilConfig): Promise<Narsil>;
|
|
|
178
197
|
*/
|
|
179
198
|
declare const VERSION = "0.1.0";
|
|
180
199
|
|
|
181
|
-
export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, StopWordOverride, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerStopWords, registerTokenizer, resetNormalizationCache };
|
|
200
|
+
export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, PatternSearch, StopWordOverride, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPatternSearch, registerStopWords, registerTokenizer, resetNormalizationCache };
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
export { VERSION, createNarsil } from './chunk-
|
|
1
|
+
export { VERSION, createNarsil } from './chunk-7QMTA7AA.mjs';
|
|
2
|
+
import './chunk-2X2ZQOAB.mjs';
|
|
2
3
|
import './chunk-GCM3JFVA.mjs';
|
|
3
|
-
import './chunk-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import './chunk-653BNMAF.mjs';
|
|
4
|
+
import './chunk-CVPA5Q7R.mjs';
|
|
5
|
+
import './chunk-XZ4PAREY.mjs';
|
|
6
|
+
export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerPatternSearch, registerStopWords, registerTokenizer } from './chunk-HVJYTKK7.mjs';
|
|
7
|
+
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-QR4OKRVY.mjs';
|
|
8
|
+
export { getLanguage, registerLanguage } from './chunk-KZTI25D3.mjs';
|
|
9
|
+
import './chunk-M6XF5HDE.mjs';
|
|
10
10
|
import './chunk-TGP5M5R7.mjs';
|
|
11
|
-
export { isSimdAvailable } from './chunk-
|
|
11
|
+
export { isSimdAvailable } from './chunk-LCCL6EEH.mjs';
|
|
12
12
|
import './chunk-ZJ4CSAB2.mjs';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-P2ZZN32C.mjs';
|
|
14
14
|
import './chunk-3L4U6EJQ.mjs';
|
|
15
15
|
import './chunk-IFBKLBGB.mjs';
|
|
16
|
+
import './chunk-3HQPUCCT.mjs';
|
|
17
|
+
import './chunk-ZKRV5M2P.mjs';
|
|
16
18
|
import './chunk-U2BKYEC7.mjs';
|
|
17
|
-
import './chunk-
|
|
19
|
+
import './chunk-LJYTW7GT.mjs';
|
|
18
20
|
import './chunk-POWOTUKJ.mjs';
|
|
19
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
21
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-RV77FR2F.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnyDocument, S as SchemaDefinition, d as ScoringMode } from './schema-
|
|
1
|
+
import { A as AnyDocument, S as SchemaDefinition, d as ScoringMode } from './schema-BBOCdhND.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Every code a {@link NarsilError} carries, grouped by the part of the engine
|
|
@@ -41,6 +41,7 @@ declare const ErrorCodes: {
|
|
|
41
41
|
readonly SEARCH_INVALID_MODE: "SEARCH_INVALID_MODE";
|
|
42
42
|
readonly SEARCH_INVALID_CURSOR: "SEARCH_INVALID_CURSOR";
|
|
43
43
|
readonly SEARCH_RESULT_WINDOW_EXCEEDED: "SEARCH_RESULT_WINDOW_EXCEEDED";
|
|
44
|
+
readonly SEARCH_WORK_CAP_EXCEEDED: "SEARCH_WORK_CAP_EXCEEDED";
|
|
44
45
|
readonly LANGUAGE_NOT_SUPPORTED: "LANGUAGE_NOT_SUPPORTED";
|
|
45
46
|
readonly ENVELOPE_VERSION_MISMATCH: "ENVELOPE_VERSION_MISMATCH";
|
|
46
47
|
readonly ENVELOPE_INVALID_MAGIC: "ENVELOPE_INVALID_MAGIC";
|
|
@@ -577,9 +578,13 @@ interface ListResult<T = AnyDocument> {
|
|
|
577
578
|
* @public
|
|
578
579
|
*/
|
|
579
580
|
type ComparisonFilter = {
|
|
580
|
-
/** This matches a field equal to the value. */
|
|
581
|
+
/** This matches a field equal to the value, or a list field where one element equals it. */
|
|
581
582
|
eq?: number | string | boolean;
|
|
582
|
-
/**
|
|
583
|
+
/**
|
|
584
|
+
* This matches a document that holds the field with a value other than this
|
|
585
|
+
* one, or a list field where every element differs from it, which an empty
|
|
586
|
+
* list does.
|
|
587
|
+
*/
|
|
583
588
|
ne?: number | string | boolean;
|
|
584
589
|
/** This matches a field greater than the number. */
|
|
585
590
|
gt?: number;
|
|
@@ -596,10 +601,10 @@ type ComparisonFilter = {
|
|
|
596
601
|
* The engine tests a text field against this filter for equality, for a text
|
|
597
602
|
* range, or with the set and prefix tests.
|
|
598
603
|
*
|
|
599
|
-
* The engine compares each element of a `string[]` or `
|
|
600
|
-
* it matches a document with `eq`, `in`, `startsWith`,
|
|
601
|
-
* one element passes the test, while it matches a document
|
|
602
|
-
* where every element differs from the values.
|
|
604
|
+
* The engine compares each element of a `string[]`, `verbatim[]`, or `enum[]` field, so
|
|
605
|
+
* it matches a document with `eq`, `in`, `startsWith`, `endsWith`, or
|
|
606
|
+
* `contains` where one element passes the test, while it matches a document
|
|
607
|
+
* with `ne` or `nin` where every element differs from the values.
|
|
603
608
|
*
|
|
604
609
|
* The engine applies the range tests `gt`, `gte`, `lt`, `lte`, and `between`
|
|
605
610
|
* to a single `string` or `verbatim` field whose type includes `sortable`,
|
|
@@ -607,6 +612,21 @@ type ComparisonFilter = {
|
|
|
607
612
|
* It orders the values as a sort on the field does, comparing their case folds
|
|
608
613
|
* first and their raw code points only where the folds are equal.
|
|
609
614
|
*
|
|
615
|
+
* A pattern field is a `verbatim` or `verbatim[]` field, or a `string` or
|
|
616
|
+
* `string[]` field whose type includes `pattern`. On such a field, the engine
|
|
617
|
+
* answers `eq`, `ne`, `in`, `nin`, `startsWith`, `endsWith`, and `contains`
|
|
618
|
+
* from the field's pattern index. `caseFold` applies to each of those tests.
|
|
619
|
+
* On an `enum` or `enum[]` field, the engine answers `eq`, `ne`, `in`, `nin`,
|
|
620
|
+
* `startsWith`, and `endsWith` from the field's index of values. It throws
|
|
621
|
+
* `SEARCH_INVALID_FILTER` for `eq`, `ne`, `in`, `nin`, `startsWith`, or
|
|
622
|
+
* `endsWith` on a `string` or `string[]` field whose type leaves out
|
|
623
|
+
* `pattern`, because such a field keeps no index of whole values.
|
|
624
|
+
* The engine compares the code points of each value as stored, with no
|
|
625
|
+
* Unicode normalisation. It throws `SEARCH_INVALID_FILTER` for `contains` or
|
|
626
|
+
* `caseFold` on any other field, for a test text longer than 1,024 code points
|
|
627
|
+
* on a pattern field, and for a `caseFold` test whose text has a case fold
|
|
628
|
+
* longer than 2,048 code points.
|
|
629
|
+
*
|
|
610
630
|
* @public
|
|
611
631
|
*/
|
|
612
632
|
type StringFilter = Pick<ComparisonFilter, 'eq' | 'ne'> & {
|
|
@@ -620,26 +640,41 @@ type StringFilter = Pick<ComparisonFilter, 'eq' | 'ne'> & {
|
|
|
620
640
|
lte?: string;
|
|
621
641
|
/** This matches a value inside the inclusive range in sort order, given as `[low, high]`. */
|
|
622
642
|
between?: [string, string];
|
|
623
|
-
/** This matches a field equal to any value in the list. */
|
|
643
|
+
/** This matches a field equal to any value in the list, which holds at most 65,536 values. */
|
|
624
644
|
in?: string[];
|
|
625
|
-
/** This matches a field that differs from every value in the list. */
|
|
645
|
+
/** This matches a field that differs from every value in the list, which holds at most 65,536 values. */
|
|
626
646
|
nin?: string[];
|
|
627
647
|
/** This matches a field starting with the text. */
|
|
628
648
|
startsWith?: string;
|
|
629
649
|
/** This matches a field ending with the text. */
|
|
630
650
|
endsWith?: string;
|
|
651
|
+
/** This matches a pattern field whose value holds the text anywhere in it. */
|
|
652
|
+
contains?: string;
|
|
653
|
+
/**
|
|
654
|
+
* When this is true, the engine compares the case fold of each value of a
|
|
655
|
+
* pattern field with the case fold of the text, so a test for `error` matches
|
|
656
|
+
* `ERROR`. It applies to `eq`, `ne`, `in`, `nin`, `startsWith`, `endsWith`,
|
|
657
|
+
* and `contains`.
|
|
658
|
+
*/
|
|
659
|
+
caseFold?: boolean;
|
|
631
660
|
};
|
|
632
661
|
/**
|
|
633
|
-
* Tests the contents of
|
|
662
|
+
* Tests the contents of a list field, which is a `number[]`, `boolean[]`,
|
|
663
|
+
* `enum[]`, `verbatim[]`, or `string[]` field.
|
|
664
|
+
*
|
|
665
|
+
* The engine throws `SEARCH_INVALID_FILTER` for these tests on any other
|
|
666
|
+
* field, for a value whose type differs from the type of the list's elements,
|
|
667
|
+
* and for `containsAll` or `matchesAny` on a `string[]` field whose type leaves
|
|
668
|
+
* out `pattern`.
|
|
634
669
|
*
|
|
635
670
|
* @public
|
|
636
671
|
*/
|
|
637
672
|
type ArrayFilter = {
|
|
638
|
-
/** This matches
|
|
673
|
+
/** This matches a list holding every one of the values, at most 65,536 of them, so an empty set of values matches every list. */
|
|
639
674
|
containsAll?: (string | number | boolean)[];
|
|
640
|
-
/** This matches
|
|
675
|
+
/** This matches a list holding at least one of the values, at most 65,536 of them. */
|
|
641
676
|
matchesAny?: (string | number | boolean)[];
|
|
642
|
-
/** This compares the
|
|
677
|
+
/** This compares the number of elements in the list. */
|
|
643
678
|
size?: ComparisonFilter;
|
|
644
679
|
};
|
|
645
680
|
/**
|
|
@@ -649,13 +684,13 @@ type ArrayFilter = {
|
|
|
649
684
|
* @public
|
|
650
685
|
*/
|
|
651
686
|
type PresenceFilter = {
|
|
652
|
-
/** This matches a document where the field
|
|
687
|
+
/** This matches a document where the field holds a value other than null. */
|
|
653
688
|
exists?: boolean;
|
|
654
|
-
/** This matches a document where the field is absent. */
|
|
689
|
+
/** This matches a document where the field is absent or null. */
|
|
655
690
|
notExists?: boolean;
|
|
656
|
-
/** This matches an empty string or an empty
|
|
691
|
+
/** This matches a document where the field is absent, null, an empty string, or an empty list. */
|
|
657
692
|
isEmpty?: boolean;
|
|
658
|
-
/** This matches a string or
|
|
693
|
+
/** This matches a document where the field holds a value other than an empty string or an empty list. */
|
|
659
694
|
isNotEmpty?: boolean;
|
|
660
695
|
};
|
|
661
696
|
/**
|
|
@@ -666,9 +701,9 @@ type PresenceFilter = {
|
|
|
666
701
|
type GeoRadiusFilter = {
|
|
667
702
|
/** The engine tests the field against this circle. */
|
|
668
703
|
radius: {
|
|
669
|
-
/** The centre has this latitude, in degrees. */
|
|
704
|
+
/** The centre has this latitude, in degrees from -90 to 90. For any other value, the engine throws `SEARCH_INVALID_FILTER`. */
|
|
670
705
|
lat: number;
|
|
671
|
-
/** The centre has this longitude, in degrees. */
|
|
706
|
+
/** The centre has this longitude, in degrees from -180 to 180. For any other value, the engine throws `SEARCH_INVALID_FILTER`. */
|
|
672
707
|
lon: number;
|
|
673
708
|
/** The circle has this radius, measured in `unit`. */
|
|
674
709
|
distance: number;
|
|
@@ -701,9 +736,11 @@ type GeoPolygonFilter = {
|
|
|
701
736
|
/**
|
|
702
737
|
* The engine closes the ring through these corners in the order that you
|
|
703
738
|
* list them, so you can leave the first point off the end. It throws
|
|
704
|
-
* `SEARCH_INVALID_FILTER` for a ring of fewer than three corners,
|
|
705
|
-
*
|
|
706
|
-
*
|
|
739
|
+
* `SEARCH_INVALID_FILTER` for a ring of fewer than three corners, which
|
|
740
|
+
* encloses no area, and for a corner whose latitude is outside -90 to 90
|
|
741
|
+
* or whose longitude is outside -180 to 180. It also throws that error for
|
|
742
|
+
* a ring of more than 65,536 corners. List the corners counter-clockwise
|
|
743
|
+
* around the area, as in an exterior ring of GeoJSON. Where the corners
|
|
707
744
|
* span 180 degrees of longitude or more, the engine matches the area on
|
|
708
745
|
* the left of that path, so a ring listed that way can cross the
|
|
709
746
|
* antimeridian or span more than half the globe.
|
|
@@ -730,11 +767,15 @@ type GeoFilter = GeoRadiusFilter | GeoPolygonFilter;
|
|
|
730
767
|
*/
|
|
731
768
|
type FieldFilter = ComparisonFilter | StringFilter | ArrayFilter | PresenceFilter | GeoFilter;
|
|
732
769
|
/**
|
|
733
|
-
* The filter a query runs, built from per-field tests and the boolean
|
|
770
|
+
* The filter that a query runs, built from per-field tests and the boolean
|
|
734
771
|
* operators that combine them.
|
|
735
772
|
*
|
|
736
|
-
*
|
|
737
|
-
* filter before scoring, so a narrow filter makes a search
|
|
773
|
+
* The engine answers every test from an index that it keeps for the field. It
|
|
774
|
+
* applies the filter before scoring, so a narrow filter makes a search
|
|
775
|
+
* cheaper. A filter nests at most 30 levels deep and holds at most 1,024
|
|
776
|
+
* tests, counted across every field and nested expression. Past either limit,
|
|
777
|
+
* the engine throws `SEARCH_INVALID_FILTER`, while it throws
|
|
778
|
+
* `SEARCH_INVALID_FIELD` for a test on a field that the schema leaves out.
|
|
738
779
|
*
|
|
739
780
|
* @public
|
|
740
781
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This object holds the code with which the engine builds the pattern index of
|
|
3
|
+
* each pattern field and answers `contains` and the other text tests on that
|
|
4
|
+
* field.
|
|
5
|
+
*
|
|
6
|
+
* A Node process loads this code by itself. A browser bundle includes it only
|
|
7
|
+
* where the app imports `patternSearch` from `@delali/narsil/pattern` and
|
|
8
|
+
* passes it to {@link registerPatternSearch}, so a bundler can leave it out of
|
|
9
|
+
* an app that has no pattern field.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
interface PatternSearch {
|
|
14
|
+
/** This is always `'pattern'`, the name of the code that the object holds. */
|
|
15
|
+
readonly name: 'pattern';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type { PatternSearch as P };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { P as PatternSearch } from './pattern-Cledccbl.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This object holds the pattern search code, which a browser app has to pass
|
|
5
|
+
* to {@link registerPatternSearch} before it creates or loads an index with a
|
|
6
|
+
* pattern field.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { registerPatternSearch } from '@delali/narsil'
|
|
10
|
+
* import { patternSearch } from '@delali/narsil/pattern'
|
|
11
|
+
*
|
|
12
|
+
* registerPatternSearch(patternSearch)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* A Node process loads the pattern search code by itself, so it needs no such
|
|
16
|
+
* call.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
declare const patternSearch: PatternSearch;
|
|
21
|
+
|
|
22
|
+
export { PatternSearch, patternSearch };
|
package/dist/pattern.mjs
ADDED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { P as PartitionConfig, d as ScoringMode, V as VectorIndexConfig } from '../../schema-
|
|
1
|
+
import { P as PartitionConfig, d as ScoringMode, V as VectorIndexConfig } from '../../schema-BBOCdhND.js';
|
|
2
2
|
import '../../adapters-79OIa4xm.js';
|
|
3
3
|
|
|
4
|
+
interface PatternIndexArrays {
|
|
5
|
+
fieldPath: string;
|
|
6
|
+
docIds: Uint32Array;
|
|
7
|
+
runs: Uint32Array;
|
|
8
|
+
offsets: Uint32Array;
|
|
9
|
+
postings: Uint32Array;
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
interface IndexMetadata {
|
|
5
13
|
indexName: string;
|
|
6
14
|
/** Number of documents represented by the last completed checkpoint. */
|
|
@@ -90,6 +98,12 @@ interface SegmentPayload {
|
|
|
90
98
|
latitudes: Float64Array;
|
|
91
99
|
longitudes: Float64Array;
|
|
92
100
|
}>;
|
|
101
|
+
pattern: PatternIndexArrays[];
|
|
102
|
+
sizes: Array<{
|
|
103
|
+
fieldPath: string;
|
|
104
|
+
docIds: Uint32Array;
|
|
105
|
+
values: Float64Array;
|
|
106
|
+
}>;
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
interface SegmentPostingColumns {
|
|
@@ -110,6 +124,8 @@ interface SegmentColumns extends SegmentPostingColumns {
|
|
|
110
124
|
boolean: SegmentPayload['boolean'];
|
|
111
125
|
enums: SegmentPayload['enums'];
|
|
112
126
|
geo: SegmentPayload['geo'];
|
|
127
|
+
pattern: SegmentPayload['pattern'];
|
|
128
|
+
sizes: SegmentPayload['sizes'];
|
|
113
129
|
surfaceForms: SerializedSurfaceForms | null;
|
|
114
130
|
}
|
|
115
131
|
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { CHECKPOINT_WORKER_HEARTBEAT_MS, createDurableDirectory, writeCheckpointSegments } from '../../chunk-
|
|
1
|
+
import { CHECKPOINT_WORKER_HEARTBEAT_MS, createDurableDirectory, writeCheckpointSegments } from '../../chunk-7QMTA7AA.mjs';
|
|
2
|
+
import '../../chunk-2X2ZQOAB.mjs';
|
|
2
3
|
import '../../chunk-GCM3JFVA.mjs';
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import '../../chunk-653BNMAF.mjs';
|
|
4
|
+
import '../../chunk-CVPA5Q7R.mjs';
|
|
5
|
+
import '../../chunk-XZ4PAREY.mjs';
|
|
6
|
+
import '../../chunk-HVJYTKK7.mjs';
|
|
7
|
+
import '../../chunk-QR4OKRVY.mjs';
|
|
8
|
+
import '../../chunk-KZTI25D3.mjs';
|
|
9
|
+
import '../../chunk-M6XF5HDE.mjs';
|
|
10
10
|
import '../../chunk-TGP5M5R7.mjs';
|
|
11
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-LCCL6EEH.mjs';
|
|
12
12
|
import '../../chunk-ZJ4CSAB2.mjs';
|
|
13
|
-
import '../../chunk-
|
|
13
|
+
import '../../chunk-P2ZZN32C.mjs';
|
|
14
14
|
import '../../chunk-3L4U6EJQ.mjs';
|
|
15
15
|
import '../../chunk-IFBKLBGB.mjs';
|
|
16
|
+
import '../../chunk-3HQPUCCT.mjs';
|
|
17
|
+
import '../../chunk-ZKRV5M2P.mjs';
|
|
16
18
|
import '../../chunk-U2BKYEC7.mjs';
|
|
17
|
-
import '../../chunk-
|
|
19
|
+
import '../../chunk-LJYTW7GT.mjs';
|
|
18
20
|
import '../../chunk-POWOTUKJ.mjs';
|
|
19
|
-
import '../../chunk-
|
|
21
|
+
import '../../chunk-RV77FR2F.mjs';
|
|
20
22
|
|
|
21
23
|
// src/persistence/durability/rebuild.ts
|
|
22
24
|
async function rebuildSegmentsFromDurable(root, metadata, targets, compactionThreshold, capturedPartitions = []) {
|