@lde/search-typesense 0.11.0 → 0.13.0
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.
|
@@ -41,6 +41,10 @@ export interface CollectionDefinitionOptions {
|
|
|
41
41
|
* only the folded `*_search_${locale}`, facet/reference and `*_sort_${locale}`
|
|
42
42
|
* companions are indexed. Keeping retrieval-only fields un-indexed is the lever
|
|
43
43
|
* for holding a large index’s RAM down.
|
|
44
|
+
*
|
|
45
|
+
* {@link isInternalField Internal fields} (those declaring no role) are omitted
|
|
46
|
+
* entirely: they exist only as a projection-time reading device for the
|
|
47
|
+
* derives, so the collection stores nothing for them.
|
|
44
48
|
*/
|
|
45
49
|
export declare function buildCollectionDefinition(searchType: SearchType, options?: CollectionDefinitionOptions): CollectionCreateSchema;
|
|
46
50
|
//# sourceMappingURL=collection-definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-definition.d.ts","sourceRoot":"","sources":["../src/collection-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"collection-definition.d.ts","sourceRoot":"","sources":["../src/collection-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAQhE,0EAA0E;AAC1E,MAAM,WAAW,2BAA2B;IAC1C;;wEAEoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;4BAGwB;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,2BAAgC,GACxC,sBAAsB,CAexB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { displayFieldPattern, physicalFields } from '@lde/search/adapter';
|
|
1
|
+
import { displayFieldPattern, isInternalField, physicalFields, } from '@lde/search/adapter';
|
|
2
2
|
import { deriveCollectionName } from './collection-name.js';
|
|
3
3
|
/**
|
|
4
4
|
* Build a Typesense collection definition from the unified {@link SearchType}, so
|
|
@@ -25,6 +25,10 @@ import { deriveCollectionName } from './collection-name.js';
|
|
|
25
25
|
* only the folded `*_search_${locale}`, facet/reference and `*_sort_${locale}`
|
|
26
26
|
* companions are indexed. Keeping retrieval-only fields un-indexed is the lever
|
|
27
27
|
* for holding a large index’s RAM down.
|
|
28
|
+
*
|
|
29
|
+
* {@link isInternalField Internal fields} (those declaring no role) are omitted
|
|
30
|
+
* entirely: they exist only as a projection-time reading device for the
|
|
31
|
+
* derives, so the collection stores nothing for them.
|
|
28
32
|
*/
|
|
29
33
|
export function buildCollectionDefinition(searchType, options = {}) {
|
|
30
34
|
const { defaultLocale } = options;
|
|
@@ -42,6 +46,13 @@ export function buildCollectionDefinition(searchType, options = {}) {
|
|
|
42
46
|
}
|
|
43
47
|
/** The physical Typesense fields one declaration produces. */
|
|
44
48
|
function typesenseFields(field, defaultLocale, defaultSortingField) {
|
|
49
|
+
// An internal field (no role) is projected as a reading device for the
|
|
50
|
+
// derives and pruned before the writer, so the collection stores nothing for
|
|
51
|
+
// it: not stored, not indexed, no RAM. Same predicate the projection prunes
|
|
52
|
+
// by, so the index and the document cannot disagree.
|
|
53
|
+
if (isInternalField(field)) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
45
56
|
const names = physicalFields(field);
|
|
46
57
|
if (field.kind === 'text') {
|
|
47
58
|
const locales = field.locales;
|
package/dist/search.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client } from 'typesense';
|
|
2
|
-
import { type LocalizedValue, type SearchEngine, type SearchResult, type SearchSchema, type SearchType, type TextField } from '@lde/search';
|
|
2
|
+
import { type LocalizedValue, type RootTypeOf, type SearchEngine, type SearchResult, type SearchSchema, type SearchType, type TextField } from '@lde/search';
|
|
3
3
|
import { type BuildSearchParamsOptions } from './query-compiler.js';
|
|
4
4
|
/** Where the engine reads documents – plus every query-compiler knob
|
|
5
5
|
* ({@link BuildSearchParamsOptions}), declared once there and forwarded
|
|
@@ -45,7 +45,7 @@ export interface TypesenseSearchEngine<Types extends readonly SearchType[] = rea
|
|
|
45
45
|
* exists), never an input. Throws for a type outside this engine’s schema,
|
|
46
46
|
* like every other entry point.
|
|
47
47
|
*/
|
|
48
|
-
collectionNameFor(searchType: Types
|
|
48
|
+
collectionNameFor(searchType: RootTypeOf<Types>): string;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* One reference field’s resolved label source: the collection it reads, the
|
package/dist/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAGL,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAGL,KAAK,cAAc,EAKnB,KAAK,UAAU,EAGf,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EAEf,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAYrB,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,q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,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AA0FD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,EACnC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAgDtC;AA6BD,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAC;IAC1E,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS;QAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS;YACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;SACxB,EAAE,CAAC;KACL,EAAE,CAAC;CACL;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,uBAAuB,EACjC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,GAC1C,YAAY,CAsCd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/search-typesense",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Typesense implementation of the @lde/search SearchEngine port: collection-schema builder, query compiler, label-resolving result reconstruction, and blue/green index lifecycle. Engine-specific (Typesense) but domain-agnostic.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "git+https://github.com/ldelements/lde.git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"!**/*.tsbuildinfo"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@lde/search": "^0.
|
|
28
|
+
"@lde/search": "^0.11.0",
|
|
29
29
|
"@lde/text-normalization": "^0.1.1",
|
|
30
30
|
"tslib": "^2.3.0",
|
|
31
31
|
"typesense": "^3.0.6"
|