From 1d4a6b0848eaf7a044e4a0b51c42afa1648e40f1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 19 Feb 2014 00:52:27 -0500 Subject: [PATCH] Fix [Attachment Content] [does not contain] searches in "all" mode --- chrome/content/zotero/xpcom/search.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js index ea9189af7..0039441ea 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -716,7 +716,8 @@ Zotero.Search.prototype.search = function(asTempTable){ // (a separate fulltext word search filtered by fulltext content) for each(var condition in this._conditions){ if (condition['condition']=='fulltextContent'){ - var filter = function(val, index, array) { + var fulltextWordIntersectionFilter = function (val, index, array) !!hash[val] + var fulltextWordIntersectionConditionFilter = function(val, index, array) { return hash[val] ? (condition.operator == 'contains') : (condition.operator == 'doesNotContain'); @@ -789,7 +790,7 @@ Zotero.Search.prototype.search = function(asTempTable){ } if (ids) { - var scopeIDs = ids.filter(filter); + var scopeIDs = ids.filter(fulltextWordIntersectionFilter); } else { var scopeIDs = []; @@ -811,7 +812,7 @@ Zotero.Search.prototype.search = function(asTempTable){ hash[val.id] = true; } - filteredIDs = scopeIDs.filter(filter); + filteredIDs = scopeIDs.filter(fulltextWordIntersectionConditionFilter); } else { var filteredIDs = [];