Skip to content

Make it possible to chose which sub-fields of the related collection we should keep #112

@bidoubiwa

Description

@bidoubiwa

Problem

If you have a collection in Strapi that has a relation with another collection, once you index it to MeiliSearch the output is the following:

 {
    "id": 2,
    "name": "Italian",
    "restaurants": [
      {
        "id": 1,
        "name": "PetitPatapon",
        "description": "Delicieux",
        "created_by": 1,
        "updated_by": 1,
        "created_at": "2021-03-03T12:09:10.979Z",
        "updated_at": "2021-03-03T12:09:10.988Z"
      },
      {
        "id": 2,
        "name": "LaLoLaLiTa",
        "description": "Ma que bello",
        "created_by": 1,
        "updated_by": 1,
        "created_at": "2021-03-03T12:17:46.503Z",
        "updated_at": "2021-03-03T12:17:46.515Z"
      }
    ]
  },

But for MeiliSearch to create facets the best way would be to transform the restaurants object into the following:

 {
    "id": 2,
    "name": "Italian",
    "restaurants": ["LaLoLaLiTa", "PetitPatapon"]
 },

Solution

It would be better that on indexation, if a relation is discovered, the user is prompted to chose one field or to ignore the questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    after-strapi-v4Issues to do after strapi v4 integrationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions