Check weither an optionalFilter is active or not

After ranking results with optionalFilter, i want to treat hits that didn’t “pass” the given filter differently, to put it the context, Its to show the “Add Friend” button (like in social media), only if the user isn’t currently friend with the current user (the optionalFilter).
I checked the documentation and the JSON variable returned with each hit, and nothing seems to indicate weither a certain hit passed the optionalFilter or not.
Is there anyway to do it ?

Hi Ahmed,

You can get the ranking info for each hit and see how many filters where applied. This will only works if you have only one filter, otherwise, you won’t know which one matched (as they’re all considered the same in term of relevance).

The best way would be to make a call with filters, instead of optionalFilters.