My question is reference to the example given in following post on significant terms use case
I have similar requirement, but it is about events instead of movies. So to answer "People who saw this event page have also saw these other events" (based on page views)
So far so good. Now, the problem is that I index the data little differently.
I have an index to store each page view as separate document which also contains all the data about event and user who saw the page
So, every time some user views an event page, I store following field
Now, I would like to recommend "People who saw this event page also viewed these events" using significant terms aggregation. But in my case I have to first get list of users who viewed the current event page, and then do another query for finding other events (but uncommonly common) viewed by all those users.
Is there a way to do that in a single query ?
Moreover, the list of users returned from first query could be in thousands. So doing a second query with filter of that many user ids would again be very.
How should I approach this ?