meilisearch / strapi-plugin-meilisearch

A strapi plugin to add your collections to Meilisearch
https://meilisearch.com
MIT License
217 stars 53 forks source link

Attributes not filterable #631

Closed azngeek closed 1 year ago

azngeek commented 1 year ago

Description I have setup Meilisearch using the instasearch plugin using the following configurations:

instantsearch.widgets.refinementList({ container: "#enabled-list", attribute: "gender" }), and this is the configuration in strapi

module.exports = () => ({ //... meilisearch: { config: { profile: { settings: { filterableAttributes: ['confirmed', 'gender'] } } } } })

Expected behavior

I expect that the attributes 'confirmed' and 'gender' are filterable.

Current behavior

Meilisearch tells me that the attributes are not filterable.

image

Screenshots or Logs If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

image

bidoubiwa commented 1 year ago

Hey @azngeek, can I see your Meilisearch plugin configuration in Strapi?

azngeek commented 1 year ago

Sure,

it is this one

module.exports = () => ({
    //...
    meilisearch: {
        config: {
            profile: {
                settings: {
                    filterableAttributes: ['confirmed', 'gender'], // add categories to filterable attributes.
                }
            }
        }
    }
})
bidoubiwa commented 1 year ago

I tried it locally and it seems to work for me. There are two possible reasons for me you might have this bug:

Can you check and uncheck profile in the Meilisearch dashboard page?

azngeek commented 1 year ago

Thanks for the feedback. I got the error. It was because i used a typescript based setup instead of vanilla js. The name of the plugin file must be plugin.ts instead of plugin.js.

bidoubiwa commented 1 year ago

Perfect! Closing this as it seems to be solved :)