Aggregations for combinations / permutations?

Are there aggregations available to calculate combinations or permutations of keywords in one field or more field per document?

Or is this a task for some painless script action I should learn?

keyword_field : ["test", "array", "for", "combinations"]

combinations of length 2:

[('array', 'test'),
 ('for', 'test'),
 ('combinations', 'test'),
 ('array', 'for'),
 ('array', 'combinations'),
 ('combinations', 'for')]

Another example would be to calculate combinations across 2 fields.

I want this to get a keywords Source, Target, Value aggregation to visualize it in a hirarchical or network graph.

Is composite aggregation close to what you need? It can list up the combination of multiple fields existing in a document. To add a field twice as a source, it will generate the combination of length 2.

Check out the adjacency matrix aggregation

1 Like

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