diff --git a/chrome/content/zotero/collectionViewItemTree.jsx b/chrome/content/zotero/collectionViewItemTree.jsx index bd9d148bf3..8ef83aa154 100644 --- a/chrome/content/zotero/collectionViewItemTree.jsx +++ b/chrome/content/zotero/collectionViewItemTree.jsx @@ -229,20 +229,10 @@ class CollectionViewItemTreeRowProvider extends ItemTreeRowProvider { let queryRow = this.collectionTreeRows.find(rowIsBestMatchSearch); let query = queryRow.getBestMatchQuery(); let source = queryRow.getBestMatchSource(); - // Each selected row's search applies a top-K cutoff to its own scope, - // so K is reapplied to the merged candidates (see Session#score()) -- - // a multi-row selection returns K members total rather than K per row. - // Only when the source is the transient Advanced Search, which applies - // uniformly to every selected row: a saved search's cutoff is part of - // that row's own membership and must not trim other selected rows' - // results. - let topK = queryRow.advancedSearch && source - ? source.getBestMatchQuery().topK - : false; // A best-match quick search shows only the items it can rank. With any // search source, membership is defined by the selected rows' own // searches, so keep unscoreable items -- they sort after the ranked - // ones. (A uniform top-K set contains no unscoreable items anyway.) + // ones let keepUnscored = !!source; let candidateIDs = items .filter(item => item instanceof Zotero.Item) @@ -266,7 +256,6 @@ class CollectionViewItemTreeRowProvider extends ItemTreeRowProvider { // Scoring derives the best-scored items' previews before it // resolves; the rest arrive through onPreviewsFilled above await session.score(candidateIDs, { - topK, // A newer filter (e.g. more typed search text) makes this // query obsolete -- stop scoring and let its refresh take over shouldCancel: () => generation !== this._bestMatchGeneration diff --git a/chrome/content/zotero/elements/zoteroSearch.js b/chrome/content/zotero/elements/zoteroSearch.js index bc164603c4..ca815a38bf 100644 --- a/chrome/content/zotero/elements/zoteroSearch.js +++ b/chrome/content/zotero/elements/zoteroSearch.js @@ -153,7 +153,6 @@ case 'bestMatch': stack[stack.length - 1].bestMatch = condition.value; - stack[stack.length - 1].bestMatchTopK = parseInt(condition.operator) || false; continue; case 'groupStart': { @@ -311,14 +310,9 @@ flat.push({ condition: 'resultLevel', operator: group.resultLevel, value: null }); } // The best-match query is a root-level modifier, offered only for - // top-level item results. The operator carries the optional top-K - // cutoff; 'contains' means rank-only. + // top-level item results if (isRoot && group.bestMatch && group.resultLevel == 'item') { - flat.push({ - condition: 'bestMatch', - operator: group.bestMatchTopK ? String(group.bestMatchTopK) : 'contains', - value: group.bestMatch - }); + flat.push({ condition: 'bestMatch', operator: 'contains', value: group.bestMatch }); } for (let child of group.conditionsContainer.children) { if (child.localName == 'zoterosearchcondition') { @@ -496,8 +490,6 @@