The validate request allows a (potentially) expensive query to be validated before it is executed.
client.execute {
validateIn("index").query(
termQuery("name", "sammy")
)
}
Replace the termQuery above with whatever query you wish to validate.
You can also get an explaination of errors by using the explain
param.
client.execute {
validateIn("index").query(
termQuery("name", "sammy")
).explain(true)
}
Read the official docs for the various flags.