Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a Elasticsearch query.

I can see the data this URL http://localhost:9200/foobar/logs/_search

But I want to get data doing a self join. I know how to do it in mysql.

But I am not sure how to do it in elasticsearch query.

Please advise.

SQL
USE foobar;
 SELECT From_unixtime(Truncate(Unix_timestamp(entry_date) / 300, 0) * 300) AS "every_5_mins",
        t2.transactionId,
        t1.eventName,
        COUNT(*)
 FROM logs t1
 LEFT JOIN foobar.logs t2
    ON t2.transactionId = t1.transactionId
   AND t2.eventType = "done"
 WHERE t1.eventName = "register"
 GROUP BY every_5_mins
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900