I am Using elastic search APIS and exporting them as a rest view. Now I wanted to filter that data according to the roles and conditions based on the content data. I have done that using the view_query_alter HOOK but I am having trouble regarding the facets. The facets show values from all data sets whereas i want it to be according to the filtered view data set.
Is there any easier way to do this or should i approach it with filtering the facets as well programmatically ?