How to add filter 'fq' in drupal 8 search api solr? I have 4 different content types, for those I have create 4 different search pages based on the page view I need to alter solr query.

In D7 we have addFilter('fq').

How can we do it in D8?
I have reached out to drupalsupport IRC got an answer from there. By the time I have got the reply from them debugged the code founded a createFilterQuery function in SearchApiSolrBackend.php file

$solarium_query-&gt;createFilterQuery('your_indexed_filedname')-&gt;setQuery('your_indexed_filedname:"string_to_be_searched"');


Here your_indexed_filedname would be something like ss_5f_test_5f_1

Don't forget to put double quotes for string to be searched, otherwise it won't fetch you the result.