Search and discovery
How book search works, what consistency to expect, and how to use filters.
Audience & Outcome: This guide is for frontend developers, AI agent builders, and operators integrating with BookWorm’s catalog discovery endpoints. You will learn how structured browsing and free-text search execute, what consistency guarantees apply, and how to isolate search symptoms.
Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs serves book discovery through two complementary query paths: structured browsing against Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs and free-text discovery combining Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs candidate retrieval with authoritative PostgreSQL hydration. Both Storefront and MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs share this architecture so displayed prices, availability, and cover links always come from the primary database.
Context and motivation
Customers discover books in two distinct ways: navigating structured facets (categories, authors, publishers, price ranges, sorting) and entering natural-language search queries. Relational SQL filtering handles exact facets well but misses semantic intent, while serving prices directly from a search index risks exposing stale commercial data during price updates or book retirements.
BookWorm combines relational accuracy with vector recall by treating Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs as a candidate-ranking projection and Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs as the authoritative hydration source.
How it works
Every discovery request enters Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs (via REST for Storefront or internal gRPC from MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs for conversational AI) and branches based on whether a free-text search term is present.
This visual shows how structured browsing queries the primary database directly while free-text search embeds the query, ranks candidates in the vector store, and hydrates authoritative rows from PostgreSQL.
Loading graph...
Query paths
| Discovery mode | Entry condition | Execution path | Authoritative data source |
|---|---|---|---|
| Structured browse | Category, publisher, author, price bounds, sort, or page parameters with no search term | Queries Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs directly and caches pages in Catalog CacheContainerv1.0.0Catalog CacheNon-authoritative FusionCache and Redis caching layer owned by the Catalog bounded context for fast book detail lookups ...Ownercatalog-experience-teamDiagramOpen docs | Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs |
| Free-text hybrid search | Search term provided (with optional facets and paging) | Embeds query via Microsoft Foundry, runs hybrid vector + keyword search in Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs for candidate book IDs, hydrates rows from Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs, applies filters/paging, and caches results | Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs candidates hydrated from Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs |
Consistency expectations
New or edited books appear in direct lookups and structured browse immediately, but appear in free-text search only after Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs processes the pending queue (triggered every 5 minutes by Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs).
- Authoritative commercial details: Prices, discount prices, availability, rating summaries, and freshly signed cover SAS URLs always come from Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs and Catalog Blob StorageContainerv1.0.0Catalog Blob StorageAuthoritative Azure Blob Storage container owned by the Catalog bounded context for binary book cover images and media a...Ownercatalog-experience-teamDiagramOpen docs, never from vector index payloads.
- Brief deletion transition window: When a BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs is soft-deleted, Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs may still return its ID as a candidate until the next Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs batch removes the vector. Hydration against Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs filters out soft-deleted books so retired titles never appear in returned results.
Separating discovery symptoms
Because discovery touches Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs, Catalog CacheContainerv1.0.0Catalog CacheNon-authoritative FusionCache and Redis caching layer owned by the Catalog bounded context for fast book detail lookups ...Ownercatalog-experience-teamDiagramOpen docs, and expiring Catalog Blob StorageContainerv1.0.0Catalog Blob StorageAuthoritative Azure Blob Storage container owned by the Catalog bounded context for binary book cover images and media a...Ownercatalog-experience-teamDiagramOpen docs SAS URLs, isolate symptoms before escalating:
- New or edited book missing from text search only: Indicates ingestion lag — follow the Vector Index Lag runbook.
- Old price or metadata shown after an update: Indicates stale cache — follow the Stale Cache or Redis Outage runbook.
- Book cover image returns HTTP
403or404: Indicates an expired SAS URL or missing blob — follow the Broken Book Images runbook.
| Decision | Benefits | Costs and limits |
|---|---|---|
| Vector candidate lookup + PostgreSQL hydration | Guarantees authoritative prices, soft-delete filtering, and live SAS URLs on every search response | Adds a relational lookup step after vector retrieval |
| Asynchronous background vector indexing | Keeps catalog writes fast and shields Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs from embedding or vector store outages | Creates a brief lag window before new or edited books appear in free-text search |
| Hashed cache keys for list and search pages | Reduces repeated embedding and database load on popular queries | Cached pages can reflect brief staleness until tag invalidation or TTL expiry (30m) |
Rejected alternatives:
- PostgreSQL full-text search alone: Struggles with semantic and conversational discovery queries from Storefront and Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs.
- Serving book prices directly from vector payloads: Risks displaying outdated prices or retired books due to eventual consistency.
Related documentation
- Product IngestionFlowv1.0.0Product IngestionCatalog API persists product changes in PostgreSQL; Scheduler triggers Catalog Ingestion over Kafka every five minutes t...Ownercatalog-experience-teamView flowOpen docs — How Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs, Kafka, and Catalog IngestionServicev1.0.0Catalog IngestionInternal background worker that reads pending Catalog book updates and synchronizes semantic search vectors in Qdrant. SubscribesProcessVectorBatchIntegrationEventOwnercatalog-experience-teamDiagramRepositoryOpen docs keep Catalog VectorContainerv1.0.0Catalog VectorNon-authoritative Qdrant vector search index owned by the Catalog bounded context for hybrid semantic and keyword book d...Ownercatalog-experience-teamDiagramOpen docs synchronized.
- Chat Agent OrchestrationFlowv1.0.0Chat Agent OrchestrationA customer submits a conversational request through Storefront; Chat API screens input, routes via a non-LLM classifier ...Ownerai-capabilities-teamView flowOpen docs — How Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs queries Catalog discovery through MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs.
- ADR-002: Use Qdrant hybrid vector and keyword search for product discoveryDecision Recordv1.0.0ADR-002: Use Qdrant hybrid vector and keyword search for product discoveryText search finds candidate book IDs in Qdrant using embeddings plus keyword matching, then loads canonical records from...Ownercatalog-experience-teamOpen docs — Architectural decision for hybrid vector and keyword search.