feat(search): single-type projection, iterable quad input, blue/green collection name#580
Open
ddeboer wants to merge 2 commits into
Open
feat(search): single-type projection, iterable quad input, blue/green collection name#580ddeboer wants to merge 2 commits into
ddeboer wants to merge 2 commits into
Conversation
…en collection name
- Add projectType(quads, searchType) to @lde/search: scope a projection to
one root type of a multi-type deployment without forging a one-type
SearchSchema brand.
- Accept Iterable<Quad> in projectType and projectGraph, so callers can pass a
chained generator merging sources instead of materializing a third array.
- Refactor framing to buildSubjectIndex + frameSubjects: projectGraph now scans
the input once, building a single subject index every type frames off, rather
than re-scanning per type.
- Expose the minted versioned collection (`${name}_<timestamp>`) on the
BlueGreenRebuild run writer as `collection`, fixed at openRun, removing the
extra aliases().retrieve() round trip after commit.
- Replace EM dashes with EN dashes in newly-added JSDoc, comments and README prose per the house language rule. - Reword the frameSubjects roots-lookup comment: it tolerates an unregistered type as a no-op (the tested contract), rather than claiming the lookup is never undefined.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes three API gaps that surfaced while migrating the Dataset Register indexer onto
@lde/search/@lde/search-typesense, each of which forced a downstream workaround.1.
@lde/search:projectType(quads, searchType)Projecting a single root type of a multi-type schema had no supported entry point:
projectGraphframes every type, and building a one-typeSearchSchematripssearchSchema()’s label-source validation — so consumers were forging theSearchSchemabrand withas unknown as SearchSchema.projectTypescopes a projection to one root type — same framing and document shape — without building (and re-validating) a schema.projectGraphnow delegates through the same framing core.2.
@lde/search: acceptIterable<Quad>projectTypeandprojectGraphnow accept anyIterable<Quad>, not just a materialized array, so a caller merging several sources can pass a chained generator (function* () { yield* a; yield* b; }) instead of building a third full array at the projection peak.Framing was refactored into
buildSubjectIndex+frameSubjects:projectGraphscans the input once, building a single subject index every type frames off, rather than re-scanning the quads per type. This makes multi-type projection both single-pass and safe over a one-shot iterable.3.
@lde/search-typesense: expose the minted collection nameBlueGreenRebuildmints and swaps to${name}_<timestamp>internally but did not report it, so a caller needing the concrete collection name had to issue an extraaliases().retrieve()aftercommit().The run writer is now typed
BlueGreenRunWriter, exposing the versioned collection asrun.collection— fixed atopenRun, before the first write — removing the round trip. (Exposed as a property rather than acommit()return value: the genericRunWriter.commit(): Promise<void>cannot be narrowed toPromise<string>throughPromise<T>.)Fix #579