feat(search)!: per-reference label sources#562
Merged
Conversation
9ef3ce7 to
cf1d24b
Compare
5f5ec05 to
aeb8500
Compare
cf1d24b to
f6ee061
Compare
aeb8500 to
ebd4a0a
Compare
ebd4a0a to
46be36a
Compare
f6ee061 to
46be36a
Compare
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.
Slice 4 of #534, stacked on #561: per-reference label sources, replacing the single global sidecar
labelscollection. Design captured in ADR 7.Schema (
@lde/search)ReferenceField.labelSourcenames theSearchTypewhose collection resolves the reference’s labels. The named type must declare anoutput,searchabletext field calledlabel– something to reconstruct a label from, and something to type ahead against (the future facet-by-name entry point).searchSchemavalidates this schema-wide, so a dangling or unsuitable source fails at startup. A reference without alabelSourcestays id-only: its IRIs never travel in a lookup.Resolving open decision 1 of #534 as decided: the global labels collection is dropped, not kept as a typeless fallback – a typed entity collection and a ‘labels collection’ are the same kind of thing (one entry in
collections).Engine (
@lde/search-typesense)multi_searchthe engine already used (per-source batches of 200).labeldeclaration (per-locale display fields), with a bare untaggedlabelvalue as theundfallback – so existing sidecar-shaped documents keep working during migration.labelCacheTtlMs) now caches per source collection, single-flight per collection.Covered by the issue’s resolver spec: labels resolve batched per source, fields without a source are pruned from lookups, dangling references degrade to id-only; plus the migrated container-backed integration suite, where the label collection is now built from the same
SearchTypedeclaration viabuildCollectionSchema.Also
Degeneralizes UI-specific “sidebar” wording in ADR 5, the READMEs and JSDoc to “a faceted listing” – the sidebar is a consumer (Dataset Register) notion, not LDE’s.
Breaking changes
TypesenseSearchEngineOptions.labelsCollectionis removed. Migration: declare each label source as aSearchType, add its collection tooptions.collections, setlabelSourceon each reference field, and rebuild label collections viabuildCollectionSchemaso the physical label fields exist.fetchLabelsnow takes label-lookup groups instead of(collection, iris).Part of #534 (slice 4; the facet-by-name two-step itself follows separately with #533’s value-query IR).