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

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

Introduction

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

Prototype

public void addSnipplets(String fieldname, List<String> snipplets) 

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 v  a 2  s  .c o m*/
    }
    return highlightEntry;
}