diff --git a/orcid-core/src/main/java/org/orcid/core/solr/OrcidSolrOrgsClient.java b/orcid-core/src/main/java/org/orcid/core/solr/OrcidSolrOrgsClient.java index 3e736bef6e0..e50cf1aa1ab 100644 --- a/orcid-core/src/main/java/org/orcid/core/solr/OrcidSolrOrgsClient.java +++ b/orcid-core/src/main/java/org/orcid/core/solr/OrcidSolrOrgsClient.java @@ -54,16 +54,18 @@ public List getOrgs(String searchTerm, int firstRe StringBuilder queryString = new StringBuilder(SOLR_ORGS_QUERY.replace("%s", searchTerm)); if (fundersOnly) { queryString.append(" AND is-funding-org:true"); - } else { - queryString.append(" AND is-funding-org:false"); - } + } SolrQuery query = new SolrQuery(); query.setQuery(queryString.toString()); query.addOrUpdateSort("score", ORDER.desc); query.addOrUpdateSort("org-disambiguated-popularity", ORDER.desc); + if(fundersOnly) { + query.addFilterQuery(String.format("(%s:(%s OR %s))", SolrConstants.ORG_DISAMBIGUATED_ID_SOURCE_TYPE, "ROR", "FUNDREF")); + } else { + query.addFilterQuery(String.format("(%s:(%s))", SolrConstants.ORG_DISAMBIGUATED_ID_SOURCE_TYPE, "ROR")); + } - query.addFilterQuery(String.format("(%s:(%s OR %s))", SolrConstants.ORG_DISAMBIGUATED_ID_SOURCE_TYPE, "ROR", "FUNDREF")); LOGGER.debug("SOLR Query: " + query.toQueryString()); try {