How to use filter_path in java api?

I found in the doc that "All REST APIs accept a filter_path parameter that can be used to reduce the response returned by elasticsearch". But I can't find this parameters in SearchRequestBuilder like other parameters.How can i use this function in java?Thinks

Hi,

when using the Java client API, you use either the node or the transport client which use another wire protocol. There is no REST client for Java and hence this option is not supported.

Note that Elasticsearch still reads all fields from the index. filter_path is just applied when a document is serialized to JSON.

Daniel

Hi,

What about the class FilterPath I found here:
https://static.javadoc.io/org.elasticsearch/elasticsearch/2.3.0/org/elasticsearch/common/xcontent/support/filtering/FilterPath.html?

Can it be used to reduce the response? Or does this class have another purpose?
I not sure to understand how it works.

Thanks

Filter path is a rest layer thing. The transport client doesn't do rest so
it isn't a thing. In 5.0 there are the beginnings of a rest client in Java
and it'll have those options.