Special case of aggregate query

Hi Team ,

I have documents stored in ES with below structure :

Column1 | Column2 | Column3

Doc1 | P1 | T1
Doc2 | P1 |
Doc3 | P1 |
Doc4 | P2 |
Doc5 | P2 | T2
Doc6 | P2 |
Doc7 | P3 | T1
Doc8 | P3 |

Is there a way in ES to aggregate on Col3 , but while aggregating pre-fill empty values of col3 with value based on matching condition ?

Like if I use general ES aggs aggregate on Col3 , the aggregate would consider data something like
T1 ->[Doc1,Doc7]
T2->[Doc5]

But , I want aggregate to consider data as below :
T1->[Doc1,Doc2,Doc3,Doc7,Doc8]
T2->[Doc4,Doc5,Doc6]

i.e it should consider documents based on matching value of Col2 of relative non-empty value of aggregate column Col3.

For ex : For Agg T2 , Doc4 and Doc6 is considered , on the basis that they have same col2 value (P2) as that of Doc5.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.