Not able to populate all data by Meilisearch pluging using populateEntryRule in my strapi project
See original GitHub issueDiscussed in https://github.com/meilisearch/meilisearch/discussions/2747
<div type='discussions-op-text'>Originally posted by giri943 September 6, 2022 I am trying to integrate meilisearch in my Strapi Project. While integrating and testing meilisearch I found that the plugin is failing to fetch all the data, especially when the data is located inside a deeply nested array. The plugin successfully fetches the data from the first level of nested array, rest of the datas are not being fetched by meilisearch plugin. I have tried using the populateEntryRule on plugin.js file which I found from the meilisearch documentation but still it’s not fetching all the data. When I fire an API call to that particular collection type through Strapi(not through meilisearch) am getting all the data correctly. Here is my particular schema that I am working with:
{
"kind": "collectionType",
"collectionName": "investors",
"info": {
"singularName": "investor",
"pluralName": "investors",
"displayName": "Investor",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"slug": {
"type": "uid",
"targetField": "title"
},
"metaData": {
"type": "component",
"repeatable": false,
"component": "seo.meta-fields"
},
"pageSections": {
"type": "dynamiczone",
"components": [
"sections.hero",
"sections.certification-section",
"sections.community-section",
"sections.content-section",
"sections.home-page-section-2",
"sections.lm-business-modal-section",
"sections.lm-evolving-section",
"sections.lm-leardership-section",
"sections.milestone-section",
"sections.mission-section",
"sections.our-business-section",
"sections.product-hero-section",
"sections.statistics-section",
"sections.team-section",
"sections.value-section",
"sections.vision-section",
"sections.webcast-section",
"sections.chart-section",
"sections.key-financials",
"sections.fixed-deposit",
"sections.financial-performance"
]
},
"Accordion": {
"type": "dynamiczone",
"components": [
"elements.no-dropdown",
"elements.dropdown"
]
}
}
}
I am having trouble in fetching the data from “pageSection” which has some deeply nested arrays of data. My Meilisearch populateEntryRule plugins.js file
module.exports = {
meilisearch: {
config: {
investor: {
populateEntryRule:['dynamiczone.pageSections', 'pageSections']
}
}
},
}
Strapi Content type structure:
Strapi API call to a collection
Meilisearch Result
I couldn’t find any related articles anywhere, that’s why I opened a discussion over here. Kindlylook into my problem and any help or suggestion will be highly appreciated.</div>
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Using this setting: https://github.com/meilisearch/strapi-plugin-meilisearch#-entries-query you can add a
populate
field which contains the rules to fetch your nested objects.https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.html#basic-populating
See #580 suggesting more information on
populate
. Closing as it is resolved 😃