use of ddf.catalog.Constants.SUGGESTION_RESULT_KEY in project ddf by codice.
the class SolrMetacardClientImpl method handleSuggestionResponse.
private void handleSuggestionResponse(QueryResponse solrResponse, Map<String, Serializable> responseProps) {
SuggesterResponse suggesterResponse = solrResponse.getSuggesterResponse();
if (suggesterResponse != null) {
List<Map.Entry<String, String>> suggestionResults = suggesterResponse.getSuggestions().values().stream().flatMap(List::stream).map(suggestion -> new AbstractMap.SimpleImmutableEntry<>(suggestion.getPayload(), suggestion.getTerm())).collect(Collectors.toList());
responseProps.put(SUGGESTION_RESULT_KEY, (Serializable) suggestionResults);
}
}
Aggregations