Meilisearch

Syncs Payload CMS collection documents to a Meilisearch index via afterChange and afterDelete hooks.

Community 39 16/wk MIT v0.1.3

Installation

pnpm add @nouance/payload-meilisearch

About

Payload Meilisearch keeps a Meilisearch instance in sync with Payload collections. You configure a `host` and `apiKey`, then declare which collections map to indexes and which fields each index should contain. Each Payload collection slug becomes a Meilisearch index name. The plugin works by injecting `afterChange` and `afterDelete` hooks into the matched collections. When a document is created or updated, the configured fields are read from the document and pushed to the corresponding Meilisearch index via `addDocuments`. When a document is deleted, the matching Meilisearch record is removed. Field configuration supports an `alias` to rename a Payload field for the index, and a `transformer` function to reshape values before indexing. Aliasing a field to `id` lets you pick which field becomes the document identifier in Meilisearch. Transformers are useful for serialising complex fields like RichText into plain searchable strings. The plugin targets Payload CMS v1 and is marked alpha. Support for drafts, nested fields, and Meilisearch index options for filtering and sorting is still on the roadmap. The set of supported Payload field types is limited to Code, Date, Email, JSON, Number, Point, Radio group, Select, Text, and Textarea.

Package info

Package name
@nouance/payload-meilisearch
Latest version
0.1.3
Unpacked size
29 kB
License
MIT
Weekly downloads
16
Last publish
Feb 26, 2023

More from NouanceLabs

View profile

Similar plugins

More in Search