diff --git a/core/api/models/messages.model.mongodb.js b/core/api/models/messages.model.mongodb.js index c1cc35074..a2341098b 100644 --- a/core/api/models/messages.model.mongodb.js +++ b/core/api/models/messages.model.mongodb.js @@ -4,4 +4,6 @@ export default function (app, options) { // Collation provided in query ensure sorting to be case insensitive w.r.t. user's language // We built indices with collation to cover the most used languages, it requires different naming... options.Model.createIndex({ createdAt: -1 }) + options.Model.createIndex({ body: 1 }, { name: 'body-en', collation: { locale: 'en', strength: 1 } }) + options.Model.createIndex({ body: 1 }, { name: 'body-fr', collation: { locale: 'fr', strength: 1 } }) } \ No newline at end of file