How to implement a user specific search?

Hi Patrick

I have a bunch of items to search. Normally I would put them in one
index and they are searchable. But I have the restriction that every
user should only see a specific subset of all the items.

You can use alias filters:

  • You have one index which contains data for all your users.
  • You have one alias for each user, which specifies the filter
    to be applied for that alias (eg { term => { user_id => 123}}
  • Your users query your index via their alias.

clint