mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-09-20 15:26:03 +08:00
updated text search
This commit is contained in:
parent
c44b3a5dcc
commit
52cb6568fc
15
imap.js
15
imap.js
|
@ -1345,12 +1345,11 @@ server.onSearch = function (path, options, session, callback) {
|
|||
case 'text': // search over entire email
|
||||
case 'body': // search over email body
|
||||
if (term.value && !ne) {
|
||||
parent.push({
|
||||
// fulltext can not be in $not section
|
||||
$text: {
|
||||
$search: term.value
|
||||
}
|
||||
});
|
||||
// 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.$text = {
|
||||
$search: term.value
|
||||
};
|
||||
} else {
|
||||
// can not search by text
|
||||
parent.push({
|
||||
|
@ -1624,7 +1623,7 @@ server.onGetQuotaRoot = function (path, session, callback) {
|
|||
this.logger.debug({
|
||||
tnx: 'quota',
|
||||
cid: session.id
|
||||
},'[%s] Requested quota root info for "%s"', session.id, path);
|
||||
}, '[%s] Requested quota root info for "%s"', session.id, path);
|
||||
|
||||
db.database.collection('mailboxes').findOne({
|
||||
user: session.user.id,
|
||||
|
@ -1660,7 +1659,7 @@ server.onGetQuota = function (quotaRoot, session, callback) {
|
|||
this.logger.debug({
|
||||
tnx: 'quota',
|
||||
cid: session.id
|
||||
},'[%s] Requested quota info for "%s"', session.id, quotaRoot);
|
||||
}, '[%s] Requested quota info for "%s"', session.id, quotaRoot);
|
||||
|
||||
if (quotaRoot !== '') {
|
||||
return callback(null, 'NONEXISTENT');
|
||||
|
|
Loading…
Reference in a new issue