How to return a default string when no content matches

I am trying to search the content on elasticsearch which will match a text. I want to return an default string if nothing matches to my search criteria.

Welcome!

Why not solving that on the client side?
If the number of hits is 0, return whatever you want.

@dadoonet We are using elasticsearch as the data source in grafana. Since it is a variable in grafana it throws an error when used inside a MySQL query. So, I wanted to return a default value as No Data or something.

I'd ask Grafana to fix that behavior.

My 2 cents.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.