docs
docs copied to clipboard
Search suggestion is enabled even without full search terms
In com.sismics.docs.core.util.indexing.LuceneIndexingHandler#findByCriteria I found this code:
if (!Strings.isNullOrEmpty(criteria.getSimpleSearch()) || !Strings.isNullOrEmpty(criteria.getFullSearch())) {
// …
suggestSearchTerms(criteria.getFullSearch(), suggestionList);
}
It means that if criteria.getSimpleSearch() is filled and criteria.getFullSearch() is null, suggestSearchTerms is called with a null parameter. It feels wrong => in this case should the suggestion search be skipped ?
You are right, suggestSearchTerms should only be called with a non null "search" parameter, otherwise it will throw NPE inside. Could you do a PR please?
Thanks, I'll do a PR after https://github.com/sismics/docs/pull/722 is merged to avoid any conflict risk