Use aggregation to recommend items

I have order objects indexed with the client id and the order's items.
I'd like to know what products recommend to a client based on the items he bought, using a collaborative filtering

I'm new to elasticsearch, and I'm following the example from here https://qbox.io/blog/building-simple-recommender-systems-for-elasticsearch-1 but I still don't know how to personalize my query based on:

[1] I don't want to make two requests, one to get the items he bought and then construct the query filter in agreggation. I'd like to make a query inside the filter that gets all items a cliente has bought even they are from different orders.

[2] I also want to make a personalized filter, based on combinations of items, since having orders containing all the items a client has purchased is practically impossible.
e.g, a client has a purchase history of 5 products (in different orders), so I want to boost results like:

  • products from orders that have those 5 items have a greater score
  • products from orders that have 4 of those 5 items have a slightly lower score
  • and so on

This constraint is unsupportable - especially if a customer's orders are distributed across multiple nodes/shards.

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