Hi All,
I have below 2 indexes with with one common fields.I have to create a new index after inner join with common field.
I am able to get query results with below query but wanted to know how to create new index with this inner join results.
index1> common field,name,city,Model_fraud
index2>common field,flag
Query:
POST _opendistro/_sql
{
“query”: “SELECT p.Name, p.Model_Flag,d.Flag,p.a FROM index1 p JOIN index2 d ON p.a = d.a”
}
Hi @sarvendras, there is something in SQL standards to create table from query result set. but we don’t support any CREATE TABLE for now. A workaround is to run your query by curl with format=raw and then pipe it with some other command to convert it to Elasticsearch bulk request format and use it to create a new index finally.