简体   繁体   中英

Indexing Strapi Dynamic Zones with Meilisearch plugin

I have a Strapi content type called portfolio , which has this Dynamic Zone:

"body": {
    "type": "dynamiczone",
    "components": [
        …
        "body.content-block-list",
        …
    ],
    "required": true
}

The body.content-block-list itself has an attribute blocks which is a repeatable component of type body.content-block :

"blocks": {
    "type": "component",
    "repeatable": true,
    "component": "body.content-block"
},

body.content-block has an attribute text :

"text": {
    "type": "richtext",
    "required": true
},

In the Strapi Meilisearch plugin, I've defined an index for the portfolio content type that looks like this:

portfolio: {
    indexName: 'content',
    populateEntryRule: []
}

What should the populateEntryRule look like to index the text attributes of the body.content-block s in the body.content-block-list s in the dynamic zone?

From the “JavaScript query” section of the Rest API Documentation , I've determined that the configuration I need is

portfolio: {
    indexName: 'content',
    populateEntryRule: {
        body: {
            populate: '*'
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM