I checked the docs but was not able to find a solution in v3 to exclude a certain facet using searchParameters.
What I'm basically trying to accomplish is that when a user is logged into our system (TYPO3), a special class is added to the body. If this class is set, I want to display every record there is (regular search). But if that class is not set, I need to exclude the facet intern which is set to 1.
Since facetsExcludes has been removed I'd like to know how I can accomplish such behaviour.

if ( $('body').hasClass('intern') !== true ){
var search = instantsearch({
indexName: 'indexname',
searchClient,
routing: false,
searchParameters: {
WHAT-SHOULD-I-PUT-HERE-TO-IGNORE-INTERN-1: {
"intern": 1
}
}
});
}
I don't want to prefilter anything, though.
The API parameter filters is what you're looking for.
This should work:
var search = instantsearch({
indexName: 'indexname',
searchClient,
searchParameters: {
filters: 'NOT intern:1',
},
});
That was too simple. :) Thanks a lot.
Most helpful comment
The API parameter
filtersis what you're looking for.This should work: