elasticsearch-java
elasticsearch-java copied to clipboard
How to convert es dsl query to string
Description
Hell team, I need to upgrade my ES version from 7.17 to 8.13. In version 7, I can use to_string to convert an es dsl query to a string type. However, I cannot find any similar method in ES java 8. Could you please help me? Thank you!
Description
ByteArrayOutputStream baos = new ByteArrayOutputStream(); JsonGenerator generator = transport.jsonpMapper().jsonProvider().createGenerator(baos); searchRequest.serialize(generator, transport.jsonpMapper()); generator.close(); System.out.println(baos);