Skip to content

Integration

@nx/search integrates by being embedded, not called over the network. The host registers its components and uses SearchService + SearchableControllerMixin in-process.

1. Sister Services

SisterDirectionSurfaceContractAuthFailure Mode
commerce (host)In-process — registers 4 components, calls SearchService, applies SearchableControllerMixinLibrary APIInherited (host JWT/Basic)In-process exception
@nx/coreConfigurationRepository, CdcTables, EnvironmentKeys, SystemConfigurationsLibraryCompile-time dependency

Commerce applies the mixin to its organizer / merchant / category / device / sale-channel / product / product-variant controllers, each overriding resolveSearchScope() to inject a merchant/tenant where scope.

2. External Systems

SystemDirectionSurfaceAuthFailure Mode
TypesenseHTTP (typesense client) — search, import, collection CRUD, healthAPI key (APP_ENV_TYPESENSE_API_KEY)Health probe → circuit breaker pauses CDC; search errors classified + retried
Kafka + DebeziumConsume CDC topics (@platformatic/kafka, Avro via avsc)SASL optional (APP_ENV_KAFKA_SASL_*)DLQ for poison messages; offsets uncommitted on failure

3. Critical Cross-Service Flows

3.1 Consumer wires per-entity search (build-time)

StepDetail
2Nodes parsed from protocol:host:port CSV; default http:localhost:8108
6embed.from wired only when DB embedding config + collection embeddingField/embeddingFields present
7Missing collections created; diverged ones logged (manual migration)

3.2 Tenant-scoped search at request time

StepDetail
2Host override returns a where object; mixin and-merges it with the caller filter
3Empty scope (null) means open search (no tenant restriction)

4. Contract Stability

SurfaceStabilityVersioning
Component registration orderstableLibrary semver (@nx/search)
SearchableControllerMixin(Base, options)stableLibrary semver
ISearchParams / ISearchResponsestableLibrary types
GET /search/{collectionName} (generic controller)stableHost URL /v1/
CDC topic names (nx.seller.{schema}.{table})coupled to Debezium connector configConnector-owned
Typesense collection schemasevolving (additive via backfill scripts)Manual migration on divergence

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.