Example usage for org.springframework.data.solr.core.query.result SolrResultPage getSize

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

Introduction

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

Prototype

int getSize();

Source Link

Document

Returns the size of the Slice .

Usage

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

static <T> List<HighlightEntry<T>> convertAndAddHighlightQueryResponseToResultPage(QueryResponse response,
        SolrResultPage<T> page) {
    if (response == null || MapUtils.isEmpty(response.getHighlighting()) || page == null) {
        return Collections.emptyList();
    }/*from w  w w  . j a  v  a2 s.c  o m*/

    List<HighlightEntry<T>> mappedHighlights = new ArrayList<HighlightEntry<T>>(page.getSize());
    Map<String, Map<String, List<String>>> highlighting = response.getHighlighting();

    for (T item : page) {
        HighlightEntry<T> highlightEntry = processHighlightingForPageEntry(highlighting, item);
        mappedHighlights.add(highlightEntry);
    }
    page.setHighlighted(mappedHighlights);
    return mappedHighlights;
}