Skip to content

feat(search-pipeline): compose search indexing as a pipeline instance#565

Merged
ddeboer merged 3 commits into
mainfrom
feat/search-pipeline
Jul 8, 2026
Merged

feat(search-pipeline): compose search indexing as a pipeline instance#565
ddeboer merged 3 commits into
mainfrom
feat/search-pipeline

Conversation

@ddeboer

@ddeboer ddeboer commented Jul 7, 2026

Copy link
Copy Markdown
Member

Slice 3 of #534, stacked on #560: the new @lde/search-pipeline package that makes search indexing an @lde/pipeline Configurable Pipeline instance.

What it does

searchIndexWriter({ schema, writer }) is the one type-changing step (quad → document), shared across engines – which is why it lives here and not inside an engine adapter:

  • buffers each dataset’s extracted CONSTRUCT quads until the dataset flushes;
  • frames and projects them with @lde/search’s projectGraph (engine-agnostic);
  • writes the documents to the engine writer’s run before forwarding the flush, so an In-place stale sweep never races its own documents;
  • passes the run lifecycle through unchanged (run context, per-dataset flush outcome, reset for the dump-fallback discard, commit/abort) – the engine writer’s update mode governs, and the pipeline never branches on it.

With this, a search index rebuild is a plain Pipeline with an extraction SparqlConstructReader and writers: searchIndexWriter({ schema, writer: new BlueGreenRebuild(...) }) – reusing Discovery → Selection → change-gate (skip-unchanged) instead of the bespoke full-rebuild indexer.

Scope notes

Releasing

New package: after merge, the first version must be published manually per the npm-bootstrap-package flow (npm view @lde/search-pipeline → 404 today).

Part of #534 (slice 3 of 4; next: per-reference label sources + facet-by-name search).

@ddeboer ddeboer force-pushed the feat/search-pipeline branch from 9062fc7 to 1cb1af9 Compare July 7, 2026 17:54
@ddeboer ddeboer force-pushed the feat/search-pipeline branch 2 times, most recently from 930010a to e739e06 Compare July 8, 2026 10:25
Base automatically changed from feat/search-rebuild-writers to main July 8, 2026 10:32
ddeboer added 3 commits July 8, 2026 12:39
New @lde/search-pipeline package: searchIndexWriter is the one
type-changing step (quad → document) between the pipeline’s quad world
and a search engine’s document world, shared across engines. It buffers
each dataset’s extracted CONSTRUCT quads until the dataset flushes,
frames and projects them with @lde/search’s projectGraph, and writes the
documents to the engine writer’s run before forwarding the flush – so an
In-place stale sweep never races its own documents. Run context,
per-dataset outcome, reset (dump-fallback discard) and commit/abort pass
through unchanged; the engine writer’s update mode governs.

Memory is bounded by one dataset’s extraction and released per flush;
bounded entity batches within one huge dataset (the two-level iteration)
are future work.
Same ERESOLVE as search-typesense: the ^0.31.4 peer predates the 0.33.0
release on main; the range now tracks the released version and the
lockfile entry follows.
@ddeboer ddeboer force-pushed the feat/search-pipeline branch from e739e06 to b9af21c Compare July 8, 2026 10:44
@ddeboer ddeboer merged commit 19bef04 into main Jul 8, 2026
2 checks passed
@ddeboer ddeboer deleted the feat/search-pipeline branch July 8, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant