@lde/search-indexer 0.2.0 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
  import { type DatasetSelector, type DistributionResolver, type Writer } from '@lde/pipeline';
2
- import type { RootType, SearchDocument } from '@lde/search';
2
+ import type { RootType, SearchDocument, SearchSchema } from '@lde/search';
3
3
  import type { Client } from 'typesense';
4
4
  import type { IndexerConfig } from './config.js';
5
5
  /** The registry-backed dataset selection the configuration describes. */
@@ -9,8 +9,13 @@ export declare function datasetSelectorFrom(config: IndexerConfig): DatasetSelec
9
9
  * {@link InPlaceRebuild} or {@link BlueGreenRebuild} per root type, its
10
10
  * collection name derived from the type – prefixed when the deployment says
11
11
  * so, so the read side must be configured with the same prefix.
12
+ *
13
+ * The mounted schema the pipeline hands each call travels into the writer: a
14
+ * type that surfaces an inline reference builds its collection from the
15
+ * Reference Type the schema resolves, so the nested fields are declared rather
16
+ * than silently dropped.
12
17
  */
13
- export declare function writerFactoryFrom(client: Client, config: IndexerConfig): (searchType: RootType) => Writer<SearchDocument>;
18
+ export declare function writerFactoryFrom(client: Client, config: IndexerConfig): (searchType: RootType, schema: SearchSchema) => Writer<SearchDocument>;
14
19
  /**
15
20
  * The distribution resolver the configuration describes: with `QLEVER_IMAGE`
16
21
  * set, an {@link ImportResolver} that imports data dumps into a
@@ -1 +1 @@
1
- {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAO5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAK1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,GACpB,CAAC,UAAU,EAAE,QAAQ,KAAK,MAAM,CAAC,cAAc,CAAC,CAWlD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,GACpB,oBAAoB,GAAG,SAAS,CA0BlC"}
1
+ {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAK1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,GACpB,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC,cAAc,CAAC,CAcxE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,GACpB,oBAAoB,GAAG,SAAS,CA0BlC"}
@@ -16,14 +16,22 @@ export function datasetSelectorFrom(config) {
16
16
  * {@link InPlaceRebuild} or {@link BlueGreenRebuild} per root type, its
17
17
  * collection name derived from the type – prefixed when the deployment says
18
18
  * so, so the read side must be configured with the same prefix.
19
+ *
20
+ * The mounted schema the pipeline hands each call travels into the writer: a
21
+ * type that surfaces an inline reference builds its collection from the
22
+ * Reference Type the schema resolves, so the nested fields are declared rather
23
+ * than silently dropped.
19
24
  */
20
25
  export function writerFactoryFrom(client, config) {
21
- return (searchType) => {
22
- const options = config.collectionPrefix
23
- ? {
24
- name: `${config.collectionPrefix}${deriveCollectionName(searchType)}`,
25
- }
26
- : {};
26
+ return (searchType, schema) => {
27
+ const options = {
28
+ schema,
29
+ ...(config.collectionPrefix
30
+ ? {
31
+ name: `${config.collectionPrefix}${deriveCollectionName(searchType)}`,
32
+ }
33
+ : {}),
34
+ };
27
35
  return config.rebuildMode === 'blue-green'
28
36
  ? new BlueGreenRebuild(client, searchType, options)
29
37
  : new InPlaceRebuild(client, searchType, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search-indexer",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "The @lde/search-pipeline indexer as a bootable process and prebuilt Docker image: loads a mounted schema-declaration module, dataset selection, Typesense connection and rebuild mode from the environment, then runs the object-grain searchIndexerPipeline once to completion. The composition layer that binds the engine-agnostic @lde/search-pipeline stages to @lde/search-typesense – the write-path counterpart of @lde/search-api-server.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
@@ -31,9 +31,9 @@
31
31
  "@lde/dataset-registry-client": "^0.9.1",
32
32
  "@lde/pipeline": "^0.35.4",
33
33
  "@lde/pipeline-console-reporter": "^0.26.4",
34
- "@lde/search": "^0.14.0",
35
- "@lde/search-pipeline": "^0.14.0",
36
- "@lde/search-typesense": "^0.17.0",
34
+ "@lde/search": "^0.15.0",
35
+ "@lde/search-pipeline": "^0.15.0",
36
+ "@lde/search-typesense": "^0.18.0",
37
37
  "@lde/sparql-qlever": "^0.15.3",
38
38
  "commander": "^15.0.0",
39
39
  "tslib": "^2.3.0",