Closed MehdiBH closed 4 months ago
Hello, thank you for reporting this! Currently in the java client those two options are present as part of the source
field:
esClient
.search(s -> s
.source(so -> so
.filter(f -> f
.excludes("field1", "field2")
.includes("field3")))
, Object.class);
However I'm not sure why it differs from what the documentation specifies, I'll investigate this.
Here's why: the server accepts both the query parameters (_source_excludes
, _source_includes
), and the source
nested structure in the body to define which fields to exclude from the response. They're equivalent, and the general approach the java client follows when requests have redundant query parameters is to just provide the builders for the body options.
Description
Hello, On SearchRequest class we do not have the possibility to define [sourceIncludes](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/8.13.1/co/elastic/clients/elasticsearch/core/GetRequest.html#sourceIncludes())() and [sourceExcludes](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/8.13.1/co/elastic/clients/elasticsearch/core/GetRequest.html#sourceExcludes())() like in java class GetRequest. However the functionality is present in the Elasticsearch documentation : ES documentation