Set<String> (SearchableConfigurable configurable, String option) { initialize(); final Set<String> words = getProcessedWordsWithoutStemming(option); final Set<OptionDescription> path = getOptionDescriptionsByWords(configurable, words); Set<String> resultSet = new HashSet<>(); if (path != null && !path.isEmpty()) { OptionDescription theOnlyResult = null; for (OptionDescription description : path) { final String hit = description.getHit(); if (hit != null) { boolean theBest = true; for (String word : words) { if (!StringUtil.containsIgnoreCase(hit, word)) { theBest = false; break; } } if (theBest) { resultSet.add(description.getPath()); } } theOnlyResult = description; } if (resultSet.isEmpty()) { resultSet.add(theOnlyResult.getPath()); } } return resultSet; }