The new Java Client requires a Java Class to specify the fields to be returned from a search request. I have reviewed the github pull request for Adding new generic client, #417 (Adding new generic client by harshavamsi · Pull Request #415 · opensearch-project/opensearch-java · GitHub) and #377 ([FEATURE] Enable Generic HTTP Actions in Java Client · Issue #377 · opensearch-project/opensearch-java · GitHub). Its not clear to me if this client will ultimately support specifying the return fields as currently provided by HLRC.
{ “size”: 1000, “query”: { “bool”: { “filter”: [ { “term”: { “module”: { “value”: “ncs”, “boost”: 1 } } } ], “adjust_pure_negative”: true, “boost”: 1 } }, “_source”: { “includes”: [ “module”, “descp”, “_id” ], “excludes”: }, “sort”: [ { “module”: { “order”: “asc” } } ] }
I would like to know if the new generic client will support json requests that specify _source “includes” or “excludes” as an option to defining the return fields via a Java class, and if a generic client is planned before HLRC support is removed in the 4.0 release. This approach would remove the need to filter out unwanted class fields and reduce bandwidth costs over time as well.