{"id":13472553,"url":"https://github.com/meilisearch/strapi-plugin-meilisearch","last_synced_at":"2026-02-23T08:08:07.243Z","repository":{"id":36977124,"uuid":"339328481","full_name":"meilisearch/strapi-plugin-meilisearch","owner":"meilisearch","description":"A strapi plugin to add your collections to Meilisearch","archived":false,"fork":false,"pushed_at":"2025-03-18T01:38:05.000Z","size":13815,"stargazers_count":231,"open_issues_count":40,"forks_count":61,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-18T02:35:28.808Z","etag":null,"topics":["meilisearch","plugin","search","strapi","strapi-plugin"],"latest_commit_sha":null,"homepage":"https://meilisearch.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meilisearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-16T08:18:12.000Z","updated_at":"2025-03-18T01:38:09.000Z","dependencies_parsed_at":"2023-02-19T10:01:29.547Z","dependency_job_id":"f31b7083-06f0-4337-bb55-738da5f141c4","html_url":"https://github.com/meilisearch/strapi-plugin-meilisearch","commit_stats":{"total_commits":224,"total_committers":18,"mean_commits":"12.444444444444445","dds":0.6428571428571428,"last_synced_commit":"a984171a553d8dd7cf5b056739354c4a0dd4210d"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fstrapi-plugin-meilisearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fstrapi-plugin-meilisearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fstrapi-plugin-meilisearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fstrapi-plugin-meilisearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meilisearch","download_url":"https://codeload.github.com/meilisearch/strapi-plugin-meilisearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245702135,"owners_count":20658550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["meilisearch","plugin","search","strapi","strapi-plugin"],"created_at":"2024-07-31T16:00:55.679Z","updated_at":"2026-02-23T08:08:07.237Z","avatar_url":"https://github.com/meilisearch.png","language":"JavaScript","funding_links":[],"categories":["Strapi v3","Integrations"],"sub_categories":["Plugin \u0026 Providers - v3","Official Integrations"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/meilisearch_strapi.svg\" alt=\"Meilisearch-Strapi\" width=\"200\" height=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eMeilisearch Strapi Plugin\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch\"\u003eMeilisearch\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/cloud?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=strapi-plugin-meilisearch\"\u003eMeilisearch Cloud\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs\"\u003eDocumentation\u003c/a\u003e |\n  \u003ca href=\"https://discord.meilisearch.com\"\u003eDiscord\u003c/a\u003e |\n  \u003ca href=\"https://roadmap.meilisearch.com/tabs/1-under-consideration\"\u003eRoadmap\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com\"\u003eWebsite\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs/faq\"\u003eFAQ\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/strapi-plugin-meilisearch\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/strapi-plugin-meilisearch.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/strapi-plugin-meilisearch/actions\"\u003e\u003cimg src=\"https://github.com/meilisearch/strapi-plugin-meilisearch/workflows/Tests/badge.svg\" alt=\"Tests\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg src=\"https://img.shields.io/badge/styled_with-prettier-ff69b4.svg\" alt=\"Prettier\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/strapi-plugin-meilisearch/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-informational\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e⚡ The Meilisearch plugin for Strapi\u003c/p\u003e\n\nMeilisearch is an open-source search engine. [Discover what Meilisearch is!](https://github.com/meilisearch/meilisearch)\n\nAdd your Strapi content-types into a Meilisearch instance. The plugin listens to modifications made on your content-types and updates Meilisearch accordingly.\n\n## Table of Contents \u003c!-- omit in TOC --\u003e\n\n- [📖 Documentation](#-documentation)\n- [🔧 Installation](#-installation)\n- [🚀 Getting started](#-getting-started)\n- [💅 Customization](#-customization)\n- [💡 Run the Playground](#-run-the-playground)\n- [🤖 Compatibility with Meilisearch and Strapi](#-compatibility-with-meilisearch-and-strapi)\n- [⚙️ Development Workflow and Contributing](#️-development-workflow-and-contributing)\n- [🌎 Community support](#-community-support)\n- [🤩 Just for the pleasure of the eyes](#-just-for-the-pleasure-of-the-eyes)\n\n## 📖 Documentation\n\nTo understand Meilisearch and how it works, see the [Meilisearch's documentation](https://www.meilisearch.com/docs/learn/getting_started/installation).\n\nTo understand Strapi and how to create an app, see [Strapi's documentation](https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html).\n\n## 🔧 Installation\n\nThis package version works with the [v5 of Strapi](https://docs.strapi.io/dev-docs/intro). If you are using [Strapi v4](https://docs-v4.strapi.io/), refer to versions under [`v0.12`](https://github.com/meilisearch/strapi-plugin-meilisearch/tree/v0.12.0), if you are using [Strapi v3](https://docs-v3.strapi.io/), consider [this README](https://github.com/meilisearch/strapi-plugin-meilisearch/tree/v3_main).\n\nInside your Strapi app, add the package:\n\nWith `npm`:\n\n```bash\nnpm install strapi-plugin-meilisearch\n```\n\nWith `yarn`:\n\n```bash\nyarn add strapi-plugin-meilisearch\n```\n\nTo apply the plugin to Strapi, a re-build is needed:\n\n```bash\nstrapi build\n```\n\nYou will need both a running Strapi app and a running Meilisearch instance. For [specific version compatibility, see this section](#-compatibility-with-meilisearch-and-strapi).\n\n### Run Meilisearch \u003c!-- omit in toc --\u003e\n\n⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no maintenance, no commitment, cancel anytime. [Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=strapi-plugin-meilisearch).\n\n🪨  Prefer to self-host? [Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=strapi-plugin-meilisearch) our fast, open-source search engine on your own infrastructure.\n\n### 🏃‍♂️ Run Strapi \u003c!-- omit in toc --\u003e\n\nIf you don't have a running Strapi project yet, you can either launch the [playground present in this project](#-run-the-playground) or [create a Strapi project](https://strapi.io/documentation/developer-docs/latest/getting-started/quick-start.html).\n\nWe recommend indexing your content-types to Meilisearch in development mode to allow the server reloads needed to apply or remove listeners.\n\nTo start playground project you first need to run from the root of the repo\n\n```bash\nyarn watch:link\n```\n\nand after that in the playground\n\n```bash\nyarn dlx yalc add --link strapi-plugin-meilisearch \u0026\u0026 yarn install\nstrapi develop\n// or\nyarn dlx yalc add --link strapi-plugin-meilisearch \u0026\u0026 yarn install\nyarn develop\n```\n\n### Run Both with Docker\n\nYou can use Docker to run Meilisearch and Strapi on the same server. A Docker configuration example can be found in the directory [`resources/docker`](resources/docker/) of this repository.\n\nTo run the Docker script add both files `Dockerfile` and `docker-compose.yaml` at the root of your Strapi project and run it with the following command: `docker-compose up`.\n\n## 🚀 Getting started\n\nNow that you have installed the plugin, a running Meilisearch instance and, a running Strapi app, let's go to the plugin page on your admin dashboard.\n\nOn the left-navbar, `Meilisearch` appears under the `PLUGINS` category. If it does not, ensure that you have installed the plugin and re-build Strapi (see [installation](#-installation)).\n\n### 🤫 Add Credentials \u003c!-- omit in toc --\u003e\n\nFirst, you need to configure credentials via the Strapi config, or on the plugin page.\nThe credentials are composed of:\n\n- The `host`: The url to your running Meilisearch instance.\n- The `api_key`: The `master` or `private` key as the plugin requires administration permission on Meilisearch.[More about permissions here](https://www.meilisearch.com/docs/reference/features/authentication.html).\n\n⚠️ The `master` or `private` key should never be used to `search` on your front end. For searching, use the `public` key available on [the `key` route](https://www.meilisearch.com/docs/reference/api/keys.html#get-keys).\n\n#### Using the plugin page\n\nYou can add your Meilisearch credentials in the `settings` tab on the Meilisearch plugin page.\n\nFor example, using the credentials from the section above: [`Run Meilisearch`](#-run-meilisearch), the following screen shows where the information should be.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/credentials-tab.png\" alt=\"Add your credentials\" width=\"600\"/\u003e\n\u003c/p\u003e\n\nOnce completed, click on the `add` button.\n\n#### Using a config file\n\nTo use the Strapi config add the following to `config/plugins.js`:\n\n```js\n// config/plugins.js\n\nmodule.exports = () =\u003e ({\n  //...\n  meilisearch: {\n    config: {\n      // Your meili host\n      host: 'http://localhost:7700',\n      // Your master key or private key\n      apiKey: 'masterKey',\n    },\n  },\n})\n```\n\nNote that if you use both methods, the config file overwrites the credentials added through the plugin page.\n\n### 🚛 Add your content-types to Meilisearch \u003c!-- omit in toc --\u003e\n\nIf you don't have any content-types yet in your Strapi Plugin, please follow [Strapi quickstart](https://strapi.io/documentation/developer-docs/latest/getting-started/quick-start.html).\n\nWe will use, as **example**, the content-types provided by Strapi's quickstart (plus the user content-type).\n\nOn your plugin homepage, you should have two content-types appearing: `restaurant`, `category` and `user`.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/content-type-tab.png\" alt=\"Content-types\" width=\"600\"/\u003e\n\u003c/p\u003e\n\nBy clicking on the left checkbox, the content-type is automatically indexed in Meilisearch. For example, if you click on the `restaurant` checkbox, the indexing to Meilisearch starts.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/indexing.gif\" alt=\"Content-types\" width=\"600\"/\u003e\n\u003c/p\u003e\n\nOnce the indexing is done, your restaurants are in Meilisearch. We will see in [start searching](#-start-searching) how to try it out.\n\n### 🪝 Apply Hooks \u003c!-- omit in toc --\u003e\n\nHooks are listeners that update Meilisearch each time you add/update/delete an entry in your content-types.\nThey are activated as soon as you add a content-type to Meilisearch. For example by clicking on the checkbox of `restaurant`.\n\nNonetheless, if you **remove a content-type** from Meilisearch by unchecking the checkbox, you need to reload the server. If you don't, actions are still listened to and applied to Meilisearch.\nThe reload is only possible in develop mode; click on the `Reload Server` button. If not, reload the server manually!\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/un-check.png\" alt=\"Remove hook from content-type\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n## 💅 Customization\n\nIt is possible to add settings for every collection. Start by creating a sub-object with the name of the collection inside your `plugins.js` file.\n\n```js\n// config/plugins.js\n\nmodule.exports = () =\u003e ({\n  //...\n  meilisearch: {\n    config: {\n      restaurant: {},\n    },\n  },\n})\n```\n\nSettings:\n\n- [🏷 Custom index name](#-custom-index-name)\n- [🪄 Transform entries](#-transform-entries)\n- [🤚 Filter entries](#-filter-entries)\n- [🏗 Add Meilisearch settings](#-add-meilisearch-settings)\n- [🔎 Entries query](#-entries-query)\n- [🔐 Selectively index private fields](#-selectively-index-private-fields)\n\n### 🏷 Custom index name\n\nBy default, when indexing a content-type in Meilisearch, the index in Meilisearch has the same name as the content-type. This behavior can be changed by setting the `indexName` property in the configuration file of the plugin.\n\nTo link a single collection to multiple indexes, you can assign an array of index names to the `indexName` property.\n\n**Example 1: Linking a Single Collection to a Single Index**\n\nIn the following examples, the `restaurant` content-type in Meilisearch is called `my_restaurant` instead of the default `restaurant`.\n\n```js\n// config/plugins.js\n\nmodule.exports = () =\u003e ({\n  //...\n  meilisearch: {\n    config: {\n      restaurant: {\n        indexName: 'my_restaurants',\n      },\n    },\n  },\n})\n```\n\n```js\n// config/plugins.js\n\nmodule.exports = () =\u003e ({\n  //...\n  meilisearch: {\n    config: {\n      restaurant: {\n        indexName: ['my_restaurants'],\n      },\n    },\n  },\n})\n```\n\nIt is possible to bind multiple content-types to the same index. They all have to share the same `indexName`.\n\nFor example if `shoes` and `shirts` should be bound to the same index, they must have the same `indexName` in the plugin configuration:\n\n```js\n// config/plugins.js\n\nmodule.exports = () =\u003e ({\n  //...\n  meilisearch: {\n    config: {\n      shirts: {\n        indexName: ['products'],\n      },\n      shoes: {\n        indexName: ['products'],\n      },\n    },\n  },\n})\n```\n\nNow, on each entry addition from both `shoes` and `shirts` the entry is added in the `product` index of Meilisearch.\n\n**Example 2: Linking a Single Collection to Multiple Indexes**\n\nSuppose you want the `restaurant` content-type to be indexed under both `my_restaurants` and `all_food_places` indexes in Meilisearch. You can achieve this by setting the `indexName` property to an array containing both index names, as shown in the configuration below:\n\n```js\n// config/plugins.js\n\nmodule.exports = () =\u003e ({\n  //...\n  meilisearch: {\n    config: {\n      restaurant: {\n        indexName: ['my_restaurants', 'all_food_places'],\n      },\n    },\n  },\n})\n```\n\n**disclaimer**\n\nNonetheless, it is not possible to know how many entries from each content-type is added to Meilisearch.\n\nFor example, given two content-types:\n\n- `Shoes`: with 300 entries and an `indexName` set to `product`\n- `Shirts`: 200 entries and an `indexName` set to `product`\n\nThe index `product` has both the entries of shoes and shirts. If the index `product` has `350` documents in Meilisearch, it is not possible to know how many of them are from `shoes` or `shirts`.\n\nWhen removing `shoes` or `shirts` from Meilisearch, both are removed as it would require too much processing to only remove one. You can still re-index only one after that.\n\n\u003cp align=\"center\"\u003eExample with two single types:\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/same-index.gif\" alt=\"Example of two content-types with same indexName\" width=\"600\"/\u003e\n\u003c/p\u003e\n\nExamples can be found [this directory](./resources/custom-index-name).\n\n### 🪄 Transform entries\n\nBy default, the plugin sent the data the way it is stored in your Strapi content-type. It is possible to remove or transform fields before sending your entries to Meilisearch.\n\nCreate the alteration function `transformEntry` in the plugin's configuration file. Before sending the data to Meilisearch, every entry passes through this function where the alteration is applied.\n\n`transformEntry` can be `synchronous` or `asynchronous`.\n\nYou can find a lot of examples in [this directory](./resources/entries-transformers).\n\n**Example**\n\nFor example, the `restaurant` content-type has a relation with the `category` content-type. Inside a `restaurant` entry the `categories` field contains an array of each category in an `object` format: `[{ name: \"Brunch\" ...}, { name: \"Italian ... }]`.\n\nThe following transforms `categories` in an array of strings containing only the name of the category:\n\n```js\n// config/plugins.js\n\nmodule.exports = {\n  meilisearch: {\n    config: {\n      restaurant: {\n        transformEntry({ entry }) {\n          // can also be async\n          return {\n            ...entry,\n            categories: entry.categories.map(category =\u003e category.name),\n          }\n        },\n      },\n    },\n  },\n}\n```\n\nResult:\n\n```json\n{\n  \"id\": 2,\n  \"name\": \"Squared Pizza\",\n  \"categories\": [\"Brunch\", \"Italian\"]\n  // other fields\n}\n```\n\nBy transforming the `categories` into an array of names, it is now compatible with the [`filtering` feature](https://www.meilisearch.com/docs/reference/features/filtering_and_faceted_search.html#configuring-filters) in Meilisearch.\n\n**Important**: You should always return the id of the entry without any transformation to [allow sync](https://github.com/meilisearch/strapi-plugin-meilisearch/issues/487) when unpublished or deleting some entries in Strapi.\n\n### 🤚 Filter entries\n\nYou might want to filter out some entries. This is possible with the `filterEntry`. Imagine you don't like `Alfredo's` restaurant. You can filter out this specific entry.\n\n`filterEntry` can be `synchronous` or `asynchronous`.\n\n```js\n// config/plugins.js\n\nmodule.exports = {\n  meilisearch: {\n    config: {\n      restaurant: {\n        filterEntry({ entry }) {\n          // can also be async\n          return entry.title !== `Alfredo`\n        },\n      },\n    },\n  },\n}\n```\n\n`Alfredo's` restaurant is not added to Meilisearch.\n\n### 🏗 Add Meilisearch settings\n\nEach index in Meilisearch can be customized with specific settings. It is possible to add your [Meilisearch settings](https://www.meilisearch.com/docs/reference/api/settings#settings_parameters#settings) configuration to the indexes you create using the `settings` field in the plugin configuration file.\n\nThe settings are added when either: adding a content-type to Meilisearch or when updating a content-type in Meilisearch. The settings are not updated when documents are added through the [`listeners`](-apply-hooks).\n\n**For example**\n\n```js\nmodule.exports = {\n  meilisearch: {\n    config: {\n      restaurant: {\n        settings: {\n          filterableAttributes: ['categories'],\n          synonyms: {\n            healthy: ['pokeball', 'vegan'],\n          },\n        },\n      },\n    },\n  },\n}\n```\n\n[See resources](./resources/meilisearch-settings) for more settings examples.\n\n### 🔎 Entries query\n\nWhen indexing a content type to Meilisearch, the plugin has to fetch the documents from your database. With `entriesQuery` it is possible to specify some options are applied during the fetching of the entries.\nThe options you can set are described in the [`findMany` documentation](https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.html#findmany) of Strapi. However, we do not accept any changes on the `start` parameter.\n\n**Common use cases**\n\nIf you are localizing your Strapi content, an additional field `locale` should also be added in `entriesQuery`.\n\n⚠️ Warning: if you do not specify `locale: \"*\"` in `entriesQuery`, you may not index all available entries, potentially leading to missing products in your search results. To ensure all entries in every language are indexed in Meilisearch, include the `locale` field with the value 'all'.\n\n```js\nmodule.exports = {\n  meilisearch: {\n    config: {\n      restaurant: {\n        entriesQuery: {\n          locale: '*',\n        },\n      },\n    },\n  },\n}\n```\n\nIf you are using Strapi 4 with the [🌍 Internationalization (i18n)](https://docs.strapi.io/developer-docs/latest/plugins/i18n.html) plugin, the `locale` field should be set to `all`.\n\nIf you want to add a collection with a relation to the collection being included, you have to configure the `populate` parameter in `entriesQuery`. See [the docs](https://docs.strapi.io/dev-docs/api/entity-service/populate) on how it works, and [an example](./resources/entries-query/populate.js) in our resources.\n\n**Example**\n\nIf you want your documents to be fetched in batches of `1000` you specify it in the `entriesQuery` option.\n\n```js\nmodule.exports = {\n  meilisearch: {\n    config: {\n      restaurant: {\n        entriesQuery: {\n          limit: 1000,\n        },\n      },\n    },\n  },\n}\n```\n\n[See resources](./resources/entries-query) for more entriesQuery examples.\n\n### 🔐 Selectively index private fields\n\nPrivate fields are sanitized by default to prevent data leaks. However, you might want to allow some of these private fields to be used for `search`, `filter` or `sort`. This is possible with the `noSanitizePrivateFields`. For example, if you have a private field called `internal_notes` in your content-type schema that you wish to include in searching, you can add it to the `noSanitizePrivateFields` array to allow it to be indexed.\n\n```js\n// config/plugins.js\n\nmodule.exports = {\n  meilisearch: {\n    config: {\n      restaurant: {\n        noSanitizePrivateFields: ['internal_notes'], // All attributes: [\"*\"]\n        settings: {\n          searchableAttributes: ['internal_notes'],\n        },\n      },\n    },\n  },\n}\n```\n\n### 🕵️‍♀️ Start Searching \u003c!-- omit in toc --\u003e\n\nOnce you have a content-type indexed in Meilisearch, you can [start searching](https://www.meilisearch.com/docs/learn/getting_started/quick_start.html#search).\n\nTo search in Meilisearch, you can use the [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch) library that integrates a whole search interface, or our [meilisearch-js](https://github.com/meilisearch/meilisearch-js) SDK.\n\n#### ⚡️ Using Instant Meilisearch \u003c!-- omit in toc --\u003e\n\nYou can have a front up and running in record time with [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/obrigado.gif\" alt=\"Restaurant demo\" width=\"600\"/\u003e\n\u003c/p\u003e\n\nIn Instant Meilisearch, you only have to provide your credentials and index name (_uid_). `restaurant` is the index name in our example.\n\nYou can have a quick preview with the following code in an HTML file. Create an HTML file, copy-paste the code below and open the file in your browser (or find it in `/front_examples/restaurant.html`).\n\n```html\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\" /\u003e\n    \u003clink\n      rel=\"stylesheet\"\n      href=\"https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/templates/basic_search.css\"\n    /\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv class=\"wrapper\"\u003e\n      \u003cdiv id=\"searchbox\" focus\u003e\u003c/div\u003e\n      \u003cdiv id=\"hits\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/dist/instant-meilisearch.umd.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/instantsearch.js@4\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      const search = instantsearch({\n        indexName: 'restaurant',\n        searchClient: instantMeiliSearch(\n          'http://localhost:7700',\n          'publicKey', // Use the public key not the private or master key to search.\n        ),\n      })\n\n      search.addWidgets([\n        instantsearch.widgets.searchBox({\n          container: '#searchbox',\n        }),\n        instantsearch.widgets.configure({ hitsPerPage: 8 }),\n        instantsearch.widgets.hits({\n          container: '#hits',\n          templates: {\n            item: `\n                      \u003cdiv\u003e\n                      \u003cdiv class=\"hit-name\"\u003e\n                          {{#helpers.highlight}}{ \"attribute\": \"name\" }{{/helpers.highlight}}\n                      \u003c/div\u003e\n                      \u003c/div\u003e\n                  `,\n          },\n        }),\n      ])\n      search.start()\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### 💛 Using Meilisearch for JS \u003c!-- omit in toc --\u003e\n\nYou can also use [meilisearch-js](https://github.com/meilisearch/meilisearch-js) to communicate with Meilisearch.\n\nThe following code is a setup that will output a restaurant after a search.\n\n```javascript\nimport { MeiliSearch } from 'meilisearch'\n;(async () =\u003e {\n  const client = new MeiliSearch({\n    host: 'http://127.0.0.1:7700',\n    apiKey: 'publicKey', // Use the public key not the private or master key to search.\n  })\n\n  // An index is where the documents are stored.\n  const response = client.index('movies').search('Biscoutte')\n})()\n```\n\n**response content**:\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 3,\n      \"name\": \"Biscotte Restaurant\",\n      \"description\": \"Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers.\",\n      \"categories\": []\n    }\n  ],\n  \"offset\": 0,\n  \"limit\": 20,\n  \"nbHits\": 1,\n  \"exhaustiveNbHits\": false,\n  \"processingTimeMs\": 1,\n  \"query\": \"biscoutte\"\n}\n```\n\n## 💡 Run the Playground\n\nInstead of adding the plugin to an existing project, you can try it out using the playground in this project.\n\n```bash\n# Root of repository\nyarn watch:link # Build the plugin and release it with yalc\n\n# Playground dir\nyarn dlx yalc add --link strapi-plugin-meilisearch \u0026\u0026 yarn install\n\n# Root of repository\nyarn playground:build # Build the playground\nyarn playground:dev # Start the development server\n```\n\nThis command will install the required dependencies and launch the app in development mode. You should be able to reach it on the [port 1337 of your localhost](http://localhost:1337/admin/).\n\n## 🤖 Compatibility with Meilisearch and Strapi\n\n**Supported Strapi versions**:\n\nComplete installation requirements are the same as for Strapi itself and can be found in the documentation under [installation Requirements](https://strapi.io/documentation/v3.x/installation/cli.html#step-1-make-sure-requirements-are-met).\n\n- Strapi `\u003e=v5.x.x`\n\nIf you are using [Strapi v3](https://github.com/strapi/strapi/tree/v3.6.9), please refer to [this README](https://github.com/meilisearch/strapi-plugin-meilisearch/tree/v0.5.1).\n\n**Supported Meilisearch versions**:\n\nThis package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/strapi-plugin-meilisearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.\n\n**Node**:\n\n- NodeJS \u003e= 18\n\n**We recommend always using the latest version of Strapi to start your new projects**.\n\n## ⚙️ Development Workflow and Contributing\n\nAny new contribution is more than welcome in this project!\n\nIf you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions!\n\n## 🌎 Community support\n\n- For general help using **Meilisearch**, please refer to [the official Meilisearch documentation](https://www.meilisearch.com/docs).\n- Contact the [Meilisearch support](https://www.meilisearch.com/docs/learn/what_is_meilisearch/contact.html)\n- Strapi [community Slack](https://slack.strapi.io/)\n- For general help using **Strapi**, please refer to [the official Strapi documentation](https://strapi.io/documentation/).\n\n## 🤩 Just for the pleasure of the eyes\n\nUsing the [foodadvisor](https://github.com/strapi/foodadvisor) restaurant demo Strapi provided. We added a searchbar to it using [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/restaurant.gif\" alt=\"Foodadvisor demo\" width=\"600\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fstrapi-plugin-meilisearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeilisearch%2Fstrapi-plugin-meilisearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fstrapi-plugin-meilisearch/lists"}