searchIds[0])); if (searchHandler == null) { throw new InvalidSearchException("The search with id '" + searchIds[0] + "' for '" + resourceName + "' resource is not recognized"); } else { + candidateSearchHandler.getSearchConfig().getId()); throw new InvalidSearchException("The search is ambiguous. Please specify " + StringUtils.join(candidateSearchHandlerIds, " or "));
/** * @see org.openmrs.module.webservices.rest.web.resource.api.SearchHandler#search(org.openmrs.module.webservices.rest.web.RequestContext) */ @Override public PageableResult search(RequestContext context) throws ResponseException { String query = context.getParameter(REQUEST_PARAM_QUERY); String localeString = context.getParameter(REQUEST_PARAM_LOCALE); String exactLocaleString = context.getParameter(REQUEST_PARAM_EXACT_LOCALE); Locale locale = null; boolean exactLocale = false; if (StringUtils.isNotBlank(localeString)) { locale = LocaleUtility.fromSpecification(localeString); if (locale == null) { throw new InvalidSearchException("Unknown locale:" + localeString); } } if (StringUtils.isNotBlank(exactLocaleString)) { exactLocale = Boolean.valueOf(exactLocaleString); } List<Drug> drugs = conceptService.getDrugs(query, locale, exactLocale, context.getIncludeAll()); return new NeedsPaging<Drug>(drugs, context); } }
throw new InvalidSearchException("Invalid searchType: " + searchType + ". Allowed values: \"equals\" and \"fuzzy\"");
throw new InvalidSearchException("Invalid searchType parameter: '" + searchType + "'. Expected '" + SEARCH_TYPE_EQUAL + "' or '" + SEARCH_TYPE_ALIKE + "'");