Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): Opensearch 3.2.0
Describe the issue: I am trying to use the java client to create and execute a Hybrid query with a filter. This is currently supported as documented in the official release notes.
- Issue n.1: The java client currently comes with a specific class HybridQuery but the builder does not come with a method that lets us set a filter. (I am going to attach screens of the available methods)
To make up for the missing method, I created the query as usual, then I obtained (with the specific method) the raw json that I had to manually modify to set the filter. Then comes another huge problem:
- Issue n.2: There is no way of executing a generic search request from a manually built json.
The java client does only permit the execution of generic requests with the method “generic().execute(genericRequest)”. This however returns a generic response object so I cannot use many of the SearchResponse methods. Also, this way I cannot specify the class the found documents should be returned as (I am reffering to the usual bi-parameter method search(searchRequest, documentClass) that i cannot use because I am forced make a generic request).
I treat this as a secodary big issue because, even after the Issue n.1 will be resolved, there could be moments in which the java client does not cover all the functionalities implemented in the latest releases. While waiting for the updates, having a generic search request that one can use, would make the users’ requests less urgent by providing a temporary fix for similar problems in the future.
Configuration: I am using Opensearch 3.2.0 (I also tried to download the latest java client and it does not contain the said method so upgrading would not resolve the issue)
Relevant Logs or Screenshots:
