fix(meilisearch): results will now properly paginate

This commit is contained in:
Danny Avila 2023-07-28 13:16:41 -04:00 committed by Danny Avila
parent 428fd5bed8
commit a2b6e9a6a8
2 changed files with 10 additions and 20 deletions

View file

@ -153,7 +153,7 @@ const createMeiliMongooseModel = function ({ index, attributesToIndex }) {
},
{ _id: 1 },
),
);
).lean();
// Add additional data from mongodb into Meili search hits
const populatedHits = data.hits.map(function (hit) {
@ -162,7 +162,7 @@ const createMeiliMongooseModel = function ({ index, attributesToIndex }) {
const originalHit = _.find(hitsFromMongoose, query);
return {
...(originalHit ? originalHit.toJSON() : {}),
...(originalHit ?? {}),
...hit,
};
});