Example usage for org.springframework.data.elasticsearch.core.query Query addIndices

List of usage examples for org.springframework.data.elasticsearch.core.query Query addIndices

Introduction

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

Prototype

void addIndices(String... indices);

Source Link

Document

Add Indices to be added as part of search request

Usage

From source file:org.springframework.data.elasticsearch.core.ElasticsearchTemplate.java

private <T> SearchRequestBuilder prepareSearch(Query query, Class<T> clazz) {
    if (query.getIndices().isEmpty()) {
        query.addIndices(retrieveIndexNameFromPersistentEntity(clazz));
    }/*from  w ww  .j  av  a  2 s. c  o m*/
    if (query.getTypes().isEmpty()) {
        query.addTypes(retrieveTypeFromPersistentEntity(clazz));
    }
    return prepareSearch(query);
}