Skip to content

feat: meilisearch rework - #526

Merged
andrey-hrinchenko merged 3 commits into
masterfrom
feat-meilisearch-rework
Aug 7, 2026
Merged

andrey-hrinchenko merged 3 commits into
masterfrom
feat-meilisearch-rework

Conversation

@andrey-hrinchenko

@andrey-hrinchenko andrey-hrinchenko commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

https://app.notion.com/p/Meilisearch-accuracy-38b36e86b6ce8058b24beb4645c45b6d?d=7e936e86b6ce82899caa8311cf77f58d&source=copy_link

Summary by CodeRabbit

  • New Features
    • Added Meilisearch administration tools for managing profiles, synchronisation, service status and search testing.
    • Search now supports products, categories, brands and content suggestions.
    • Product searches and links preserve selected variants, including variant names and identifiers.
    • Added content indexing for published articles and pages.
  • Improvements
    • Enhanced catalogue search ranking, filtering, facets and price handling.
    • Added fallback behaviour when search is temporarily unavailable.
    • Added scheduled regular and full search-index synchronisation.
    • Added content autocomplete labels in supported languages.

@vercel

This comment was marked as spam.

@coderabbitai

This comment was marked as spam.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR reworks Meilisearch-backed catalog and content search.

  • Adds configurable search profiles, administration endpoints, synchronization jobs, and index management.
  • Adds storefront autocomplete across products, categories, brands, articles, and pages.
  • Adds variant-aware product search links and selection.
  • Adds a bounded Medusa catalog fallback when Meilisearch is unavailable.
  • Fixes the previously reported content-document deletion ID and fallback pagination metadata mismatches.

Confidence Score: 5/5

The PR appears safe to merge based on the eligible follow-up findings.

No blocking failure remains; the content-removal path now targets the indexed underscore-delimited ID, and degraded catalog responses use the database query count to preserve pagination.

Important Files Changed

Filename Overview
apps/medusa-be/src/modules/meilisearch/content-events.ts Reconciles CMS publication changes with content indexes and now uses the same underscore-delimited document ID as normal indexing.
apps/medusa-be/src/modules/meilisearch/documents.ts Builds normalized product and content search documents, including stable content IDs and storefront links.
apps/medusa-be/src/api/store/catalog/products/route.ts Implements profile-backed catalog search and now derives degraded-mode pagination from Medusa query metadata.
apps/medusa-be/src/modules/meilisearch/synchronize.ts Implements full and incremental synchronization of profile-specific search indexes.
apps/medusa-be/src/api/store/search/autocomplete/route.ts Adds multi-index autocomplete results for products, taxonomy entities, and CMS content.
apps/herbatika/src/components/search-results.tsx Extends the search page with related category, brand, and content results alongside product listings.
apps/herbatika/src/components/product-detail/use-product-detail-data.ts Selects a requested search-result variant on product-detail initialization while retaining first-variant fallback behavior.

Sequence Diagram

sequenceDiagram
  participant CMS as Payload CMS
  participant API as Medusa Backend
  participant Meili as Meilisearch
  participant Store as Herbatika Storefront
  CMS->>API: Content change webhook
  API->>Meili: Add or remove content document
  Store->>API: Catalog or autocomplete query
  API->>Meili: Search configured profile indexes
  Meili-->>API: Ranked products and related entities
  API-->>Store: Products, facets, pagination, and suggestions
  alt Meilisearch unavailable
    API->>API: Query bounded Medusa catalog fallback
    API-->>Store: Degraded response with database count
  end
Loading

Reviews (2): Last reviewed commit: "fix: meilisearch rework" | Re-trigger Greptile

Comment thread apps/medusa-be/src/modules/meilisearch/content-events.ts Outdated
Comment thread apps/medusa-be/src/api/store/catalog/products/route.ts Outdated
@github-actions

This comment was marked as low quality.

coderabbitai[bot]

This comment was marked as low quality.

coderabbitai[bot]

This comment was marked as low quality.

@coderabbitai

This comment was marked as low quality.

coderabbitai[bot]

This comment was marked as low quality.

@andrey-hrinchenko
andrey-hrinchenko merged commit a1ef294 into master Aug 7, 2026
6 of 7 checks passed
This was referenced Aug 8, 2026
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@coderabbitai coderabbitai Bot mentioned this pull request Aug 11, 2026

This branch was successfully deployed

1 active deployment
Preview — 5d889bbe Deployed Aug 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant