Is it possible to extract subset of bucket1, where bucket1 has the same value as bucket2 on different fields?


hey folks,
I've tried to summarize my idea in the title.

My thought was to get a subset of a bucket:
for example: there ar two buckets:
in both of the buckets i have a set of documents.
bucket1 is complete. Now iwant all the documents of bucket2, where the value of bucket2.someField === bucket1.another_notTheSameField.
Can anybody help?

(Zachary Tong) #2

Hard to say without a more concrete example, but you can embed a second aggregation inside the first which has some further limiting criteria.

E.g. first aggregation is a terms aggregation on field: foo. All documents in the bucket will have the same value for the field foo. If you put a second aggregation inside the first (like a filter aggregation), you'll get a filtered subset of the documents.

(system) #3

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