-
Notifications
You must be signed in to change notification settings - Fork 64
Labels
after-strapi-v4Issues to do after strapi v4 integrationIssues to do after strapi v4 integrationenhancementNew feature or requestNew feature or request
Description
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.
Darvey, taker93 and ablaas
Metadata
Metadata
Assignees
Labels
after-strapi-v4Issues to do after strapi v4 integrationIssues to do after strapi v4 integrationenhancementNew feature or requestNew feature or request