Example usage for org.springframework.data.elasticsearch.core.query NativeSearchQuery setPageable

List of usage examples for org.springframework.data.elasticsearch.core.query NativeSearchQuery setPageable

Introduction

In this page you can find the example usage for org.springframework.data.elasticsearch.core.query NativeSearchQuery setPageable.

Prototype

<T extends Query> T setPageable(Pageable pageable);

Source Link

Document

restrict result to entries on given page.

Usage

From source file:org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder.java

public NativeSearchQuery build() {
    NativeSearchQuery nativeSearchQuery = new NativeSearchQuery(queryBuilder, filterBuilder, sortBuilder,
            highlightFields);//from   w  ww . j a  v  a  2s.  c om
    if (pageable != null) {
        nativeSearchQuery.setPageable(pageable);
    }
    if (indices != null) {
        nativeSearchQuery.addIndices(indices);
    }
    if (types != null) {
        nativeSearchQuery.addTypes(types);
    }
    if (fields != null) {
        nativeSearchQuery.addFields(fields);
    }
    if (CollectionUtils.isNotEmpty(facetRequests)) {
        nativeSearchQuery.setFacets(facetRequests);
    }
    return nativeSearchQuery;
}