How to exclude many documents

I have indexed all Users (10 million records) and I plan to index a Table that store visits of a user to another user.
I wish to show to the User 100 users they have never visited.
For some users I have to exclude up to 80'000 already visited users.

How should I Index the visits? As 1 doc for one visit or all visits from a user in 1 doc?
And how should I query the proposed users?

I have seen there is now the join datatype but I'm not sure uf this is the right way and how to use it.

I'm using ES 6.4.


What about this:

May need to check about the size of your field where you store your ids.

Hope it can help.

This seems to require that I store all visits of one user inside one doc, but one field supports up to around 10'000 chars and will not allow me to store more then 1300 7-digit numbers.

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