strapi-plugin-meilisearch icon indicating copy to clipboard operation
strapi-plugin-meilisearch copied to clipboard

Explain how to fetch nested collection in `EntriesQuery`

Open bidoubiwa opened this issue 3 years ago • 4 comments

Using the entriesQuery parameter, you can add a field named populate that helps you fetch nested collection.

See example

https://github.com/meilisearch/strapi-plugin-meilisearch/blob/85ca7d349e37ba887dcdb8c7343a26b805d1d645/resources/entries-query/populate.js#L1-L11

See doc in Strapi on how populate works.

It would be nice to add some information in the Readme about populate for users not aware that they need to use populate to fetch nested collections (see #506)

bidoubiwa avatar Nov 15 '22 11:11 bidoubiwa

Does this entriesQuery populate config also work for dynamic zone components in Strapi so you can search across text content inside dynamic zone components?

simon-online avatar Jul 24 '23 02:07 simon-online

Hey @simon-online, I'm sorry but you'll need to ask that to strapi. I'm just passing the configuration directly to strapi's ORM without any changes

bidoubiwa avatar Jul 24 '23 08:07 bidoubiwa

Ok, so as long as the configuration is valid then Strapi will return the content for a dynamic zone.

However it sounds like strapi-plugin-meilisearch currently hasn't been tested with dynamic zone components so there could be an issue or it may just work if the data is in the same format as a repeatable component.

simon-online avatar Jul 24 '23 13:07 simon-online

Hey @simon-online, yes, it was not tested, unfortunately.

bidoubiwa avatar Jul 25 '23 11:07 bidoubiwa