-
Notifications
You must be signed in to change notification settings - Fork 64
Description
I have a corporate/institutional website with a blog, and we use Strapi as the CMS for the blog.
For indexed search on the website, we use the Meilisearch plugin for Strapi, along with InstantSearch (a front-end tool for Meilisearch).
Everything works fine until someone updates a blog post — when that happens, the Meilisearch index in Strapi is updated as expected. So far, so good.
However, after every update, we have to manually re-define the filterableAttributes and searchableAttributes via cURL (using Postman or Insomnia).
Otherwise, InstantSearch/Meilisearch stops working properly.
I initially tried defining the attributes in /config/plugins.js like this:
module.exports = ({ env }) => ({
meilisearch: {
config: {
host: "**",
apiKey: "*",
"blog-post": {
settings: {
filterableAttributes: [
"category.name",
"tipo.name",
"tags.tag_nome",
"category.slug",
"tags.slug",
],
sortableAttributes: ["updatedAt"],
rankingRules: [
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
],
},
},
"library-post": {
settings: {
filterableAttributes: [
"category.name",
"tipo.name",
"tags.tag_nome",
"category.slug",
"tags.slug",
],
sortableAttributes: ["updatedAt"],
rankingRules: [
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
],
},
},
},
},
});
But it doesn’t seem to work. Even with these settings in place, I still need to define the attributes manually using cURL.
Is there a way to set these attributes automatically (without using cURL or external API calls)?
Any help would be greatly appreciated!
