@lde/search-pipeline 0.34.0 → 0.35.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.
@@ -1 +1 @@
1
- {"version":3,"file":"search-index-writer.d.ts","sourceRoot":"","sources":["../src/search-index-writer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,SAAS,EAAE,CACT,UAAU,EAAE,QAAQ,EACpB,MAAM,EAAE,YAAY,KACjB,MAAM,CAAC,cAAc,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAAC,mBAAmB,CAAC,CA+M7B"}
1
+ {"version":3,"file":"search-index-writer.d.ts","sourceRoot":"","sources":["../src/search-index-writer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,SAAS,EAAE,CACT,UAAU,EAAE,QAAQ,EACpB,MAAM,EAAE,YAAY,KACjB,MAAM,CAAC,cAAc,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAAC,mBAAmB,CAAC,CAqO7B"}
@@ -134,7 +134,25 @@ export function searchIndexWriter(options) {
134
134
  // have rolled back or swept. Every collection is flushed, not just the
135
135
  // ones that received documents this dataset: a collection an earlier
136
136
  // run held documents for still needs its sweep to reconcile.
137
- await settleAll(runs.values(), 'flush', 'collection', (run) => run.flush?.(dataset, outcome));
137
+ //
138
+ // A dataset fails as a whole, though: when one collection fails it
139
+ // (a rollback that threw, or a collection refusing too many of its
140
+ // documents), the collections that took it are flushed again as
141
+ // failed, so a Blue/green swap never ships the dataset in one
142
+ // collection and not in the one its documents join to.
143
+ const flushed = [];
144
+ try {
145
+ await settleAll(runs.values(), 'flush', 'collection', async (run) => {
146
+ await run.flush?.(dataset, outcome);
147
+ flushed.push(run);
148
+ });
149
+ }
150
+ catch (error) {
151
+ if (outcome === 'success') {
152
+ await Promise.allSettled(flushed.map((run) => run.flush?.(dataset, 'failed')));
153
+ }
154
+ throw error;
155
+ }
138
156
  },
139
157
  reset: async (dataset) => {
140
158
  // Let every collection’s run discard whatever it already holds for the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search-pipeline",
3
- "version": "0.34.0",
3
+ "version": "0.35.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",
@@ -25,14 +25,14 @@
25
25
  "!**/*.tsbuildinfo"
26
26
  ],
27
27
  "dependencies": {
28
- "@lde/search": "^0.31.0",
28
+ "@lde/search": "^0.32.1",
29
29
  "@traqula/generator-sparql-1-1": "^1.3.1",
30
30
  "@traqula/parser-sparql-1-1": "^1.3.1",
31
31
  "@traqula/rules-sparql-1-1": "^1.2.0",
32
32
  "tslib": "^2.3.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@lde/search-typesense": "^0.37.0",
35
+ "@lde/search-typesense": "^0.38.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.8.0",
43
- "@lde/pipeline": "^0.38.1"
43
+ "@lde/pipeline": "^0.39.0"
44
44
  }
45
45
  }