I'm using Jest Client along with Query builder. Not able to find how to perform source filtering.
How to set _source field to false using query builder?
You need to use fetchSource() like this:
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder()
.query(query)
.fetchSource(false);