From bb7a7ab961099148566fe12a47cae535287f41e6 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 26 Oct 2024 02:17:40 -0400 Subject: [PATCH] Match annotation text and comments in All Fields & Tags mode I think this was only in Everything for historical reasons -- in the initial implementation of search modes, tags, notes, and (old) annotations were all in Everything, but tags and notes were later moved to All Fields & Tags. The old `annotation` condition wasn't moved, and when I added `annotationComment` and `annotationText`, I just left them in the same place. But if we match notes in All Fields & Tags, we should match annotation comments, and if we're matching comments, we might as well match annotation text as well. https://forums.zotero.org/discussion/119123/note-annotations-zotero-search-and-zotero-pdf-viewer-search --- chrome/content/zotero/xpcom/data/search.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/search.js b/chrome/content/zotero/xpcom/data/search.js index a1f2e30935..23a105e119 100644 --- a/chrome/content/zotero/xpcom/data/search.js +++ b/chrome/content/zotero/xpcom/data/search.js @@ -328,13 +328,12 @@ Zotero.Search.prototype.addCondition = function (condition, operator, value, req this.addCondition('field', operator, part.text, false); this.addCondition('tag', operator, part.text, false); this.addCondition('note', operator, part.text, false); + this.addCondition('annotationText', operator, part.text, false); + this.addCondition('annotationComment', operator, part.text, false); } this.addCondition('creator', operator, part.text, false); if (condition == 'quicksearch-everything') { - this.addCondition('annotationText', operator, part.text, false); - this.addCondition('annotationComment', operator, part.text, false); - if (part.inQuotes) { this.addCondition('fulltextContent', operator, part.text, false); }