Source filtering with Java High Level Rest Client

How can you perform source filtering with the Java High Level Rest Client

For example if I'm doing a reindex request, I would do something like the following to only include the fields which are relevant to me.

POST _reindex
    "source": {
        "index": "twitter",
        "_source": ["user", "_doc"]
    "dest": {
        "index": "new_twitter"

Is it even possible to achieve the same through the Java Client's ReindexRequest?

ReindexRequest reindexRequest = new ReindexRequest();
// how can you set the fields to include?


you can change the underlying search request, that is used within the reindex request


hope this helps.


Yes, that is exactly what I needed.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.