Example usage for org.springframework.data.elasticsearch.core.query GetQuery getId

List of usage examples for org.springframework.data.elasticsearch.core.query GetQuery getId

Introduction

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

Prototype

public String getId() 

Source Link

Usage

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

@Override
public <T> T queryForObject(GetQuery query, Class<T> clazz) {
    ElasticsearchPersistentEntity<T> persistentEntity = getPersistentEntityFor(clazz);
    GetResponse response = client/*  ww  w  .j  a v  a 2  s.  c  om*/
            .prepareGet(persistentEntity.getIndexName(), persistentEntity.getIndexType(), query.getId())
            .execute().actionGet();
    return mapResult(response.getSourceAsString(), clazz);
}