sql - Elasticsearch Join columns from different index with condition -
i have 2 different indexes in elasticsearch, indx1
, indx2
have indexed sql database using river plugin.
indx1 ---------- id | amt 1 2 2 3 3 2 1 9 2 4 ----------
indx 2
---------- id | name 1 alex 2 joe 3 mary ----------
i want create new index calculate average amount indx1
, join in single index. final structure of index should
indx_final ---------- id | name | avg amt | status 1 alex 5.5 high 2 joe 3.5 med 3 mary 2.0 low ----------
the status set according average amount , if avg amt > 4 , status = high, if avg amt >3, status = med, if avg amt <2.5 ,status = low. possible in elasticsearch only? if not possible have calculation in sql , index data again.
any appreciated. thanks!
Comments
Post a Comment