use of org.orcid.frontend.web.controllers.helper.SearchOrcidSolrCriteria in project ORCID-Source by ORCID.
the class RegistrationController method findPotentialDuplicatesByFirstNameLastName.
private List<OrcidProfile> findPotentialDuplicatesByFirstNameLastName(String firstName, String lastName) {
LOGGER.debug("About to search for potential duplicates during registration for first name={}, last name={}", firstName, lastName);
List<OrcidProfile> orcidProfiles = new ArrayList<OrcidProfile>();
SearchOrcidSolrCriteria queryForm = new SearchOrcidSolrCriteria();
queryForm.setGivenName(firstName);
queryForm.setFamilyName(lastName);
String query = queryForm.deriveQueryString();
OrcidMessage visibleProfiles = orcidSearchManager.findOrcidsByQuery(query, DUP_SEARCH_START, DUP_SEARCH_ROWS);
if (visibleProfiles.getOrcidSearchResults() != null) {
for (OrcidSearchResult searchResult : visibleProfiles.getOrcidSearchResults().getOrcidSearchResult()) {
orcidProfiles.add(searchResult.getOrcidProfile());
}
}
LOGGER.debug("Found {} potential duplicates during registration for first name={}, last name={}", new Object[] { orcidProfiles.size(), firstName, lastName });
return orcidProfiles;
}
Aggregations