Search and Indexing
Learn how AutoCore uses PostgreSQL as truth and Meilisearch as a derived public search projection.
PostgreSQL is the authoritative transactional source. Meilisearch is a derived read projection optimized for public listing search, facets, sorting, and suggestions. Search documents flatten selected listing, catalog, seller, media, and location facts for query efficiency; sensitive fields such as VIN are not included in the document.
Index lifecycle
- A listing is created, updated, approved, or its status changes.
- The API requests synchronization of the listing document.
- The index service builds a denormalized document from PostgreSQL.
- Meilisearch upserts the document or removes it when it is no longer eligible.
- A full or bulk reindex can reconcile drift from PostgreSQL.
Text alternative: PostgreSQL remains authoritative; the API and Worker update a derived Meilisearch projection, which may lag or become unavailable without changing transactional truth.
Consistency and degraded mode
Indexing is asynchronous at the service boundary, so a short projection delay is possible. The public search service falls back to PostgreSQL when Meilisearch is unconfigured or fails. The fallback preserves the response contract but does not provide the same Meilisearch facet distribution. This is a degraded mode, not evidence that the derived index is authoritative.
Filters and reindexing
Search supports text, catalog, seller, dealer-verification, price, year, mileage, location, technical, equipment, and media-presence filters. Index settings define searchable, filterable, and sortable attributes. Reindexing is an administrative recovery concept; detailed operational commands belong to the operations phase.