I am a total beginner with Algolia, so I am sorry if my question is somewhat stupid. I have been searching for hours now without result, so I am craving for any help you could provide.
I will try to make myself the clearest I can.
I have tutorials with different statuses (online, offline, work_in_progress etc) and a creator id in my index that I want to display.
I use algoliasearch helper JS in a rails environement without front framework.
What I would like to do
I would like to display every tutos except for the one that are with the status “work_in_progress”, unless the current user is the tutorial’s owner.
A typical if condition (in pseudo code, but should be in JS) would look like this :
if (status != 'work_in_progress') then display else if (status == 'work_in_progress' && user_id != current_user.id) then reject
What I have tried
I have tried to remove after the search the unwanted results, but it brokes my pagination.
I also tried to add multiples refinements, but the two condition are applied on all tutorials, so it prevents every tutorials that are not “work_in_progress” or not owned by the current user to be displayed.
I looked in Algolia query rules without success.
I know I should filter even before searching, with filters, refinement and so on, but I am unable to find what I am looking for.
Any help or documentation would be appreciated.