}
getHighlightWords(searchString);
query = getQueryString(searchString, condSearchString, parentCtxt, docType, rsrcUrl, false);
SearchResults searchResults = searchCache.get(query);
if(searchResults == null) {
searchResults = searchService.doSearch(query, ureq.getIdentity(), ureq.getUserSession().getRoles(), true);
searchCache.put(query, searchResults);
}
if (searchResults.getList().isEmpty() && !query.endsWith(FUZZY_SEARCH)) {
// result-list was empty => first try to find word via spell-checker
if (doSpellCheck) {
Set<String> didYouMeansWords = searchService.spellCheck(query);
if (didYouMeansWords != null && !didYouMeansWords.isEmpty()) {
setDidYouMeanWords(didYouMeansWords);
} else {
searchResults = doFuzzySearch(ureq, searchString, condSearchString, parentCtxt, docType, rsrcUrl);
}
} else {
searchResults = doFuzzySearch(ureq, searchString, condSearchString, parentCtxt, docType, rsrcUrl);
}
}
if(searchResults.getList().isEmpty()) {
showInfo("found.no.result.try.fuzzy.search");
}
return searchResults;
} catch (ParseException e) {
if(log.isDebug()) log.debug("Query cannot be parsed: " + query);