@lde/search-pipeline 0.53.0 → 0.54.1

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { searchIndexerPipeline } from './search-indexer-pipeline.js';
2
- export type { SearchIndexerPipelineOptions } from './search-indexer-pipeline.js';
2
+ export type { ExtractionTuning, SearchIndexerPipelineOptions, } from './search-indexer-pipeline.js';
3
3
  export { registrySource, searchStages, selectByClass, } from './search-stages.js';
4
4
  export type { SearchStagesOptions, SearchStageType } from './search-stages.js';
5
5
  export { extractionQuery, extractionQueryString } from './extraction.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EACV,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -2,6 +2,25 @@ import type { Dataset } from '@lde/dataset';
2
2
  import { Pipeline, type DatasetSelector, type DistributionResolver, type Reporter, type ProvenanceStore, type QuadTransform, type ReaderContext, type Writer } from '@lde/pipeline';
3
3
  import type { RootType, SearchDocument, SearchSchema } from '@lde/search';
4
4
  import type { TypedSearchDocument } from './typed-search-document.js';
5
+ /**
6
+ * How a root type’s stage reads: how many roots each Extraction CONSTRUCT
7
+ * binds and how many queries run at once. Unset fields keep the
8
+ * {@link SearchStageType} defaults.
9
+ */
10
+ export interface ExtractionTuning {
11
+ /**
12
+ * Roots per Extraction CONSTRUCT from a dump the pipeline imported
13
+ * ({@link SearchStageType.batchSize}). @default 100
14
+ *
15
+ * A live endpoint always takes 10 roots per CONSTRUCT, whatever this says:
16
+ * other users share it, and it may fail on larger queries. A dump imported
17
+ * for this run alone is where a larger batch pays off.
18
+ */
19
+ readonly batchSize?: number;
20
+ /** Maximum concurrent SPARQL queries for the stage
21
+ * ({@link SearchStageType.maxConcurrency}). @default 10 */
22
+ readonly maxConcurrency?: number;
23
+ }
5
24
  /** Options for {@link searchIndexerPipeline}. */
6
25
  export interface SearchIndexerPipelineOptions {
7
26
  /**
@@ -85,6 +104,17 @@ export interface SearchIndexerPipelineOptions {
85
104
  * re-indexes every dataset.
86
105
  */
87
106
  restrictRoots?: Readonly<Record<string, string>>;
107
+ /**
108
+ * {@link ExtractionTuning} for every root type’s stage, such as a larger
109
+ * batch for a deployment that only reads imported dumps.
110
+ */
111
+ tuning?: ExtractionTuning;
112
+ /**
113
+ * {@link ExtractionTuning} per root type, keyed by {@link SearchType.name};
114
+ * a field set here wins over {@link tuning}. A name the schema does not
115
+ * declare throws at wiring time.
116
+ */
117
+ tuningByType?: Readonly<Record<string, ExtractionTuning>>;
88
118
  /**
89
119
  * Optional per-dataset processing memory: skip a dataset whose source
90
120
  * fingerprint and {@link pipelineVersion} both match the stored record.
@@ -134,8 +164,8 @@ export interface SearchIndexerPipelineOptions {
134
164
  * adding it costs the behaviour rather than this whole composition.
135
165
  *
136
166
  * A deployment that needs more – a bespoke root selector (the entry point is a
137
- * domain fact, not a class), per-stage tuning (`batchSize`, `maxConcurrency`),
138
- * non-SPARQL readers, or quad-level plugins – composes {@link searchStages},
167
+ * domain fact, not a class), non-SPARQL readers, or quad-level plugins –
168
+ * composes {@link searchStages},
139
169
  * {@link searchIndexWriter} and {@link Pipeline} directly, restating the
140
170
  * registry sourcing, provenance and reporting this function wires; beyond
141
171
  * those, this convenience owns no capability of its own.
@@ -1 +1 @@
1
- {"version":3,"file":"search-indexer-pipeline.d.ts","sourceRoot":"","sources":["../src/search-indexer-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAEzB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C;;;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D;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC1D;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,QAAQ,EAAE,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,QAAQ,CAAC,mBAAmB,CAAC,CA0C/B"}
@@ -1,6 +1,6 @@
1
1
  import { ManualDatasetSelection, Pipeline, } from '@lde/pipeline';
2
2
  import { searchIndexWriter } from './search-index-writer.js';
3
- import { registrySource, searchStages, selectByClass, } from './search-stages.js';
3
+ import { defaultBatchSize, registrySource, searchStages, selectByClass, } from './search-stages.js';
4
4
  /**
5
5
  * Wire the common **object-grain** search indexer and return the ready-to-run
6
6
  * {@link Pipeline}: one projecting stage per {@link RootType} in the schema,
@@ -32,16 +32,17 @@ import { registrySource, searchStages, selectByClass, } from './search-stages.js
32
32
  * adding it costs the behaviour rather than this whole composition.
33
33
  *
34
34
  * A deployment that needs more – a bespoke root selector (the entry point is a
35
- * domain fact, not a class), per-stage tuning (`batchSize`, `maxConcurrency`),
36
- * non-SPARQL readers, or quad-level plugins – composes {@link searchStages},
35
+ * domain fact, not a class), non-SPARQL readers, or quad-level plugins –
36
+ * composes {@link searchStages},
37
37
  * {@link searchIndexWriter} and {@link Pipeline} directly, restating the
38
38
  * registry sourcing, provenance and reporting this function wires; beyond
39
39
  * those, this convenience owns no capability of its own.
40
40
  */
41
41
  export function searchIndexerPipeline(options) {
42
- const { schema, datasets, registryTypes, transforms, restrictRoots = {}, } = options;
42
+ const { schema, datasets, registryTypes, transforms, restrictRoots = {}, tuning = {}, tuningByType = {}, } = options;
43
43
  const fromRegistry = registryTypeNames(schema, registryTypes?.names);
44
44
  assertDeclaredTypeNames(schema, Object.keys(transforms ?? {}), 'transform');
45
+ assertDeclaredTypeNames(schema, Object.keys(tuningByType), 'tuned');
45
46
  assertRestrictable(schema, restrictRoots, fromRegistry);
46
47
  const sourceFor = registryTypes === undefined
47
48
  ? undefined
@@ -59,6 +60,7 @@ export function searchIndexerPipeline(options) {
59
60
  itemSelector: rootSelector(searchType, restrictRoots),
60
61
  sourceFor: fromRegistry.has(searchType.name) ? sourceFor : undefined,
61
62
  transform: transforms?.[searchType.name],
63
+ ...tuningFor(searchType, tuning, tuningByType),
62
64
  })),
63
65
  }),
64
66
  writers: searchIndexWriter({ schema, writerFor: options.writerFor }),
@@ -122,6 +124,21 @@ function versionWithRestrictions(pipelineVersion, restrictRoots) {
122
124
  ? pipelineVersion
123
125
  : `${pipelineVersion}+restrictRoots=${JSON.stringify(restrictRoots)}`;
124
126
  }
127
+ /** The type’s stage tuning: each {@link ExtractionTuning} field from
128
+ * {@link SearchIndexerPipelineOptions.tuningByType} when set there, else from
129
+ * {@link SearchIndexerPipelineOptions.tuning}, with the batch size applied to
130
+ * imported dumps only. */
131
+ function tuningFor(searchType, tuning, tuningByType) {
132
+ // Own keys only, as in rootSelector.
133
+ const own = Object.hasOwn(tuningByType, searchType.name)
134
+ ? tuningByType[searchType.name]
135
+ : {};
136
+ const imported = own?.batchSize ?? tuning.batchSize;
137
+ return {
138
+ batchSize: imported === undefined ? undefined : { ...defaultBatchSize, imported },
139
+ maxConcurrency: own?.maxConcurrency ?? tuning.maxConcurrency,
140
+ };
141
+ }
125
142
  /** The type’s {@link selectByClass} selector, restricted by its
126
143
  * {@link SearchIndexerPipelineOptions.restrictRoots} pattern if it has one. */
127
144
  function rootSelector(searchType, restrictRoots) {
@@ -61,9 +61,16 @@ export interface SearchStageType {
61
61
  /**
62
62
  * Roots (and so documents) per batch – the memory bound. Under a root-bound
63
63
  * selector it moves memory and request count, never output.
64
- * @default 10
64
+ *
65
+ * Each batch is one Extraction CONSTRUCT, whose planning costs the same
66
+ * however many roots it binds, so larger batches finish a type sooner. A
67
+ * QLever import of 17574 roots ran 5.5 times faster at 100 roots per batch
68
+ * than at 10; past 100 the query grows faster than it saves. A live endpoint
69
+ * shared with other users keeps 10.
70
+ *
71
+ * @default { endpoint: 10, imported: 100 }
65
72
  */
66
- batchSize?: number;
73
+ batchSize?: StageOptions<TypedSearchDocument>['batchSize'];
67
74
  /** Maximum concurrent in-flight SPARQL queries for this stage. @default 10 */
68
75
  maxConcurrency?: number;
69
76
  /**
@@ -185,4 +192,9 @@ export declare function selectByClass(searchType: RootType, rootVariable?: strin
185
192
  * ```
186
193
  */
187
194
  export declare function registrySource(endpoint: URL): NonNullable<SearchStageType['sourceFor']>;
195
+ /** {@link SearchStageType.batchSize} when the type sets none. */
196
+ export declare const defaultBatchSize: {
197
+ readonly endpoint: 10;
198
+ readonly imported: 100;
199
+ };
188
200
  //# sourceMappingURL=search-stages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-stages.d.ts","sourceRoot":"","sources":["../src/search-stages.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,UAAU,EAAE,QAAQ,CAAC;IACrB;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;;;;;;;OAQG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,GACZ,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAK3C;AAED,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;CAA2C,CAAC"}
@@ -71,7 +71,7 @@ export function searchStages(options) {
71
71
  readers,
72
72
  itemSelector: type.itemSelector,
73
73
  sourceFor: type.sourceFor,
74
- batchSize: type.batchSize,
74
+ batchSize: type.batchSize ?? defaultBatchSize,
75
75
  maxConcurrency: type.maxConcurrency,
76
76
  queueCapacity: type.queueCapacity,
77
77
  project: async function* (quads, context) {
@@ -208,5 +208,7 @@ export function registrySource(endpoint) {
208
208
  ? distribution
209
209
  : Distribution.sparql(endpoint, dataset.iri.toString());
210
210
  }
211
+ /** {@link SearchStageType.batchSize} when the type sets none. */
212
+ export const defaultBatchSize = { endpoint: 10, imported: 100 };
211
213
  /** The class of a root type that describes the dataset being indexed. */
212
214
  const DCAT_DATASET = 'http://www.w3.org/ns/dcat#Dataset';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search-pipeline",
3
- "version": "0.53.0",
3
+ "version": "0.54.1",
4
4
  "description": "Search indexing as an @lde/pipeline instance: a Writer<Quad> that applies the @lde/search projection to extracted RDF and fans each document out to the transactional engine writer for its type's collection. Glue between the pipeline quad world and the search-engine document world; owns no projection or engine logic itself.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
@@ -32,7 +32,7 @@
32
32
  "tslib": "^2.3.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@lde/search-typesense": "^0.56.0",
35
+ "@lde/search-typesense": "^0.57.1",
36
36
  "@rdfjs/types": "^2.0.1",
37
37
  "n3": "^2.13.12",
38
38
  "testcontainers": "^12.1.0",
@@ -40,6 +40,6 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@lde/dataset": "^0.10.1",
43
- "@lde/pipeline": "^0.49.0"
43
+ "@lde/pipeline": "^0.50.1"
44
44
  }
45
45
  }