Query sem dados

Is there a way to do some elasticquery and if it didn't work, it returns something default?

I'm not totally sure what you mean. Which product are you using? Are you wanting to do a custom Elasticsearch query?

I will give an example

SELECT p1,p2,p3 FROM "teste-2021.3*" 

if this happens i would like to have some standard data type: p1 = 0, p2 = 0 and p3 = 0, but as there is no data, even if I do this in the query itself with 'case' it does not solve

You should check the rowcount after receiving the data. If it is 0 set the defaults.
This example shows how to do it

Thanks, I'm checking, and I already realized that he still brings information even without outputs, however I am very new in elastic and I still couldn't, please if possible I could make an example on top of the one I sent.