@lde/search-typesense 0.11.0 → 0.12.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;AAIhE,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;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,2BAAgC,GACxC,sBAAsB,CAexB"}
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search-typesense",
3
- "version": "0.11.0",
3
+ "version": "0.12.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.9.0",
28
+ "@lde/search": "^0.10.0",
29
29
  "@lde/text-normalization": "^0.1.1",
30
30
  "tslib": "^2.3.0",
31
31
  "typesense": "^3.0.6"