I have written a query in oracle. i want to convert this query in elastic search

Below is the query i have written in Oracle i need to write same in Elastic search.

select sum(total_count),datasource from
(select distinct faspdf_os_id,FASPDF_CUST_ID,FASPDF_PROD_ID,FASPDF_TIME_ID,total_count,datasource from fas_final_denom) group by datasource;

Please provide me the solution for this. I need this urgently

Any input will be really appreciated

Thanks
Md Furqan

Have a look at: https://github.com/NLPchina/elasticsearch-sql and you should be able to figure it out.

Hi

I looked into your link but it is different than what i am expecting.

This is plugin which uses sql as input instead of json.

But what i want the how to convert that sql query in elastic search query

The same query i want to generate in elastic search

Thanks
Md Furqan

Well if you install the plugin, there's an option to "show JSON query" which will give you the equivalent ES query syntax from the specified SQL syntax.

Hi
Thanks for replying back.

As per my understanding i need to install the plugin in elastic search using plugin install command.

But i will get the option to generate the json query for the sql.

What is the command for that and how to run it

Thanks

I have just started learning Elastic search and randomly i get this as a requirement
I need this in urgent basis if you can help me in this then it will be really appreciated.

It's all in the documentation: https://github.com/NLPchina/elasticsearch-sql

For ES 2.3: ./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.0.0/elasticsearch-sql-2.3.0.0.zip