From a708a219f957fa877ee9284f92eb8a0b9052bac0 Mon Sep 17 00:00:00 2001 From: Florian Boulnois Date: Wed, 27 Sep 2023 11:14:03 -0400 Subject: [PATCH] fix: use institution name for searches --- src/pages/DatasetSearch.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/pages/DatasetSearch.js b/src/pages/DatasetSearch.js index e31cd32201..28722e1123 100644 --- a/src/pages/DatasetSearch.js +++ b/src/pages/DatasetSearch.js @@ -20,8 +20,8 @@ export const DatasetSearch = (props) => { }, '/datalibrary_broad': { query: { - 'match': { - 'submitter.institution.id': '150' // Broad Institute of MIT and Harvard + 'match_phrase': { + 'submitter.institution.name': 'The Broad Institute of MIT and Harvard' } }, icon: broadIcon, @@ -29,8 +29,29 @@ export const DatasetSearch = (props) => { }, '/datalibrary_mgb': { query: { - 'match': { - 'submitter.institution.id': '88' // Massachusetts General Hospital + 'bool': { + 'should': [ + { + 'match_phrase': { + 'submitter.institution.name': 'Massachusetts General Hospital' + } + }, + { + 'match_phrase': { + 'submitter.institution.name': 'Brigham and Women\'s Hospital' + } + }, + { + 'match_phrase': { + 'submitter.institution.name': 'Faulkner Hospital' // TODO: identify exact name + } + }, + { + 'match_phrase': { + 'submitter.institution.name': 'Spaulding Hospital' // TODO: identify exact name + } + } + ] } }, icon: mgbIcon,