Hi,
I am using the Elasticsearch Java client and what I basically want to achieve is the following: Our backend is basically a ES Proxy, so there is an endpoint that takes an ES query as input, adds a clause (to scope the query and apply some restrictions on the documents available to find) and then sends it over to ES, piping the the response from ES through to the user/frontend again.
So the part that I'm struggling with is adding the extra clauses. I know I can construct a SearchQuery via Json:
val searchRequest = SearchRequest.of {
it.withJson(query.byteInputStream())
it.index("some_index")
}
I can see in the inspector that the query is parsed correctly and represented in the SearchQuery object. Sending this to ES also produces the expected results. I don't see how I can manipulate the query inside searchRequest
after parsing it.
Thanks in advance!