feat: meilisearch rework - #526
Open
andrey-hrinchenko wants to merge 2 commits into
Open
Conversation
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Greptile SummaryThis PR reworks Meilisearch-backed catalog and content search.
Confidence Score: 5/5The 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.
|
| 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
Reviews (2): Last reviewed commit: "fix: meilisearch rework" | Re-trigger Greptile
This comment was marked as low quality.
This comment was marked as low quality.
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.
https://app.notion.com/p/Meilisearch-accuracy-38b36e86b6ce8058b24beb4645c45b6d?d=7e936e86b6ce82899caa8311cf77f58d&source=copy_link
Summary by CodeRabbit