Skip to content

How can I pass request_cache while making a call with searchTemplate? #920

@rakesh-nayak

Description

@rakesh-nayak

Description

How can I pass request_cache=true while making a call with searchTemplate?

version: elasticsearch-java:8.13.4

Sample code below

private final ElasticsearchAsyncClient elasticsearchAsyncClient;

 public SearchTemplateResponse<Object> getResponse(TemplateQuery templateQuery) {
       var results = elasticsearchAsyncClient.searchTemplate(templateQuery.getRequest(), Object.class)
                .exceptionally(e -> {
                    return null;
                });
        final var res = results.join();
        return res;
    }

Here templateQuery.getRequest() is typeof SearchTemplateRequest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client codeCategory: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions