# "Often buyed together" using aggregations?

**URL:** <https://discuss.elastic.co/t/often-buyed-together-using-aggregations/109106>\
**Category:** Elasticsearch\
**Created:** [November 25, 2017, 4:26pm UTC](https://discuss.elastic.co/t/often-buyed-together-using-aggregations/109106 "2017-11-25T16:26:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [November 25, 2017, 9:06pm UTC](https://discuss.elastic.co/t/often-buyed-together-using-aggregations/109106/4 "2017-11-25T21:06:25Z")

</div>

You need to create order docs where purchased item IDs are held in an array on the order doc. Query for an item ID and use the 'significant\_terms' aggregation on the order itemIDs field to find strongly related other purchases.  
See [Graph explore api for webshop case](https://discuss.elastic.co/t/graph-explore-api-for-webshop-case/99582/7?u=mark_harwood)

---

_[View the full topic](https://discuss.elastic.co/t/often-buyed-together-using-aggregations/109106)._
