Prerequisites
- Node.js: active LTS or maintenance LTS versions, currently Node.js >=18.0.0 <=20.x.x
- npm >=6.0.0 (installed with Node.js)
- A running instance of Meilisearch (v >= 1.x). If you need help with this part, you can consult the Installation section.
Create a back end using Strapi
Set up the project
Create a directory calledmy-app
where you will add the back and front-end parts of the application. Generate a back-end API using Strapi inside my-app
:
back
and opens the admin dashboard. Create an account to access it.

Build and manage your content
The next step is to create a new collection type. A collection is like a blueprint of your content—in this case, it will be a collection of restaurants. You will create another collection called “Category” to organize your restaurants later.
- creating collection types
- creating new entries
- setting roles & permissions
- publishing the content
Expand your database
After finishing those steps of Strapi’s quick start guide, two new collections named Restaurant and Category should have appeared underContent Manager > Collection Types
. If you click on Restaurant
, you can see that there is only one. Add more by clicking the + Create new entry
button in the upper-right corner of the dashboard.

Save
and then Publish
.
- Name:
The Butter Biscotte
- Description:
All about butter, nothing about health.
French food
category on the bottom right corner of the page.

-
Name:
The Slimy Snail
-
Description:
Gastronomy is made of garlic and butter.
-
Category:
French food
-
Name:
The Smell of Blue
-
Description:
Blue Cheese is not expired, it is how you eat it. With a bit of butter and a lot of happiness.
-
Category:
French food
Connect Strapi and Meilisearch
To add the Meilisearch plugin to Strapi, you need to first quit the Strapi app. Go to the terminal window running Strapi and pushCtrl+C
to kill the process.
Next, install the plugin in the back
directory.
meilisearch
plugin on the left side of the screen.

meilisearch
plugin page.

Collections
tab on the meilisearch
plugin page, you should see the restaurant
and category
content-types.
By clicking on the checkbox next to restaurant
, the content-type is automatically indexed in Meilisearch.

restaurant
’s checkbox in the Collections
tab. This means that each time you add, update or delete an entry in your restaurant content-types, Meilisearch is automatically updated.
Once the indexing finishes, your restaurants are in Meilisearch. Access the search preview confirm everything is working correctly by searching for “butter”.
