Returning a subset of documents

Hi there,

I have the following scenario where I don't know a solution yet.

Imagine you have your typical users on a website. Each user has a collection of objects. These objects have several attributes and belong to a set A. Given you have a subset B (with a very small cardinality - e.g. |B| = 5) of A and you want to return the users which have most of the objects in B, how would you set up your index in ES?
Example: A = {obj1, obj2,...,obj100}; user1 has {obj1, obj67, obj77}; user2 has { obj1, obj44, obj54}; B={obj1, obj67}. Then ES should return user1 before user2.

My idea is to create an index where a document has the attributes of the objects and a user_id.
A filter should be the right approach.

Any ideas? I hope my explanation was understandable.

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