diff --git a/chrome/content/zotero/xpcom/data/search.js b/chrome/content/zotero/xpcom/data/search.js index 1642127741..f729b54320 100644 --- a/chrome/content/zotero/xpcom/data/search.js +++ b/chrome/content/zotero/xpcom/data/search.js @@ -1244,7 +1244,11 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () { // -- should probably use a temporary table instead if (hasFilter){ let subids = yield obj.search(); - condSQL += subids.join(); + condSQL += "itemID "; + if (condition.operator == 'isNot') { + condSQL += "NOT "; + } + condSQL += "IN (" + subids.join(); } // Otherwise just put the SQL in a subquery else {