Hi,
I have an index with lot of data. Is there a way to get the unique documents from the index based on 3 fields. I tried collapse and aggregates
collapse allows to get unique documents based on 1 field
aggregate gives me the unique values from documents but it doesn't return the complete document based on unique fields.
ex:
PUT myindex/_doc/uid1
{
source: 'source1',
client: 'client1',
tag: 'tag1',
combinations: ['rule1', 'rule2', 'rule3']
}
PUT myindex/_doc/uid2
{
source: 'source1',
client: 'client1',
tag: 'tag1',
combinations: ['rule3', 'rule4', 'rule5']
}
PUT myindex/_doc/uid3
{
source: 'source2',
client: 'client1',
tag: 'tag1',
combinations: ['rule7', 'rule2', 'rule3']
}
With above data based on source, client and tag, I want to get docs uid1 and uid3 as uid 2 has same source, client and tag as uid1