Search in sources :

Example 1 with ResultProcessingConverter

use of org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchQueryExecution.ResultProcessingConverter in project spring-data-elasticsearch by spring-projects.

the class AbstractReactiveElasticsearchRepositoryQuery method execute.

private Object execute(ElasticsearchParameterAccessor parameterAccessor) {
    ResultProcessor processor = queryMethod.getResultProcessor().withDynamicProjection(parameterAccessor);
    Query query = createQuery(new ConvertingParameterAccessor(elasticsearchOperations.getElasticsearchConverter(), parameterAccessor));
    if (queryMethod.hasAnnotatedHighlight()) {
        query.setHighlightQuery(queryMethod.getAnnotatedHighlightQuery());
    }
    Class<?> targetType = processor.getReturnedType().getTypeToRead();
    String indexName = queryMethod.getEntityInformation().getIndexName();
    IndexCoordinates index = IndexCoordinates.of(indexName);
    ReactiveElasticsearchQueryExecution execution = getExecution(parameterAccessor, new ResultProcessingConverter(processor));
    return execution.execute(query, processor.getReturnedType().getDomainType(), targetType, index);
}
Also used : Query(org.springframework.data.elasticsearch.core.query.Query) RepositoryQuery(org.springframework.data.repository.query.RepositoryQuery) ResultProcessingConverter(org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchQueryExecution.ResultProcessingConverter) ResultProcessor(org.springframework.data.repository.query.ResultProcessor) IndexCoordinates(org.springframework.data.elasticsearch.core.mapping.IndexCoordinates)

Aggregations

IndexCoordinates (org.springframework.data.elasticsearch.core.mapping.IndexCoordinates)1 Query (org.springframework.data.elasticsearch.core.query.Query)1 ResultProcessingConverter (org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchQueryExecution.ResultProcessingConverter)1 RepositoryQuery (org.springframework.data.repository.query.RepositoryQuery)1 ResultProcessor (org.springframework.data.repository.query.ResultProcessor)1