Fixed IMAP search for text indexes

This commit is contained in:
Andris Reinman 2017-08-10 13:23:59 +03:00
parent 11c4f583f8
commit 2c4e43b2e8

View file

@ -62,8 +62,10 @@ module.exports = server => (path, options, session, callback) => {
// fulltext can only be in the root of the query, not in $not, $or expressions
// https://docs.mongodb.com/v3.4/tutorial/text-search-in-aggregation/#restrictions
query.user = session.user.id;
query.searchable = true;
query.$text = {
$search: term.value
$search: term.value,
$language: 'none'
};
} else {
// can not search by text
@ -367,10 +369,10 @@ module.exports = server => (path, options, session, callback) => {
}
uidList.push(message.uid);
processNext();
setImmediate(processNext);
});
};
processNext();
setImmediate(processNext);
});
};