Hi,
I'm migrating from the High Level Rest Client to Java Client and have problem to log the requests that are sent to ES.
I'm not using direct query, but somethink like this:
final var countRequest = new CountRequest.Builder()
.index("myindex")
.query(Query.of(b -> b.matchAll(QueryBuilders.matchAll().build())))
.build();
Can I see somewhere the real query? Something like
POST myindex/_count
{
"query": {
"match_all": {}
}
}
Maybe, logging the query would be suffient, for High Level Rest Client this was very easy:
final var s = new SearchSourceBuilder().query(QueryBuilders.matchAllQuery()).toString();
in the s we've got
{"query":{"match_all":{"boost":1.0}}}
When I do QueryBuilders.matchAll().toString() for Java Client, I'm getting co.elastic.clients.elasticsearch._types.query_dsl.MatchAllQuery$Builder@ab7948b
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.