diff --git a/CHANGELOG.md b/CHANGELOG.md index dcb3c5dfe..5f4a6fe74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### Bug Fixes - Allow users with only annotation access to edit annotations ([#1267](../../pull/1267)) +- Fix filtering item lists in Girder by multiple phrases ([#1272](../../pull/1272)) ## 1.23.3 diff --git a/girder/girder_large_image/web_client/views/itemList.js b/girder/girder_large_image/web_client/views/itemList.js index fb045c153..b1f36788a 100644 --- a/girder/girder_large_image/web_client/views/itemList.js +++ b/girder/girder_large_image/web_client/views/itemList.js @@ -263,7 +263,7 @@ wrap(ItemListWidget, 'render', function (render) { } }); } - const key = `${coltag}:` + phrases.join('|||'); + const key = `${coltag || ''}:` + phrases.map((p) => p.phrase + (p.exact ? '__exact__' : '')).join('|||'); if (!phrases.length || usedPhrases[key]) { return; } @@ -301,12 +301,12 @@ wrap(ItemListWidget, 'render', function (render) { if (key && exact) { clause.push({[key]: {$regex: '^' + phrase + '$', $options: 'i'}}); if (!_.isNaN(numval)) { - clause.push({[key]: {$eq: numval}}); + clause.push({[key]: numval}); } } else if (key) { clause.push({[key]: {$regex: phrase, $options: 'i'}}); if (!_.isNaN(numval)) { - clause.push({[key]: {$eq: numval}}); + clause.push({[key]: numval}); if (numval > 0 && delta) { clause.push({[key]: {$gte: numval, $lt: numval + delta}}); } else if (numval < 0 && delta) {