I am trying to create DataQueryInterface (API Layer) which is independent from backend Datasource. Current I am thinking to have ElasticSearch as my datasource but in future if I want to move out of ElasticSearch, that should not break my API layer. For that I was looking at exposing KQL as my DataQueryInterface (API Layer). That way I would have deserialization code from KQL and if I want to move out of ElasticSearch in future, I can use Kibana's deserialization code to populate my POJOs and then form new query to new database.
Could someone please help pointing me to the exact code for this?