Example usage for org.springframework.data.solr.core.query.result HighlightEntry HighlightEntry

List of usage examples for org.springframework.data.solr.core.query.result HighlightEntry HighlightEntry

Introduction

In this page you can find the example usage for org.springframework.data.solr.core.query.result HighlightEntry HighlightEntry.

Prototype

public HighlightEntry(T entity) 

Source Link

Usage

From source file:org.springframework.data.solr.core.ResultHelper.java

private static <T> HighlightEntry<T> processHighlightingForPageEntry(
        Map<String, Map<String, List<String>>> highlighting, T pageEntry) {
    HighlightEntry<T> highlightEntry = new HighlightEntry<T>(pageEntry);
    Object itemId = getMappedId(pageEntry);

    Map<String, List<String>> highlights = highlighting.get(itemId.toString());
    if (MapUtils.isNotEmpty(highlights)) {
        for (Map.Entry<String, List<String>> entry : highlights.entrySet()) {
            highlightEntry.addSnipplets(entry.getKey(), entry.getValue());
        }/*from   w w w.  j a va 2  s .  co m*/
    }
    return highlightEntry;
}