How to exclude items from search api solr by negative keywords field
You don't need to do this in solr, you can do it in the query or with views filters.

Something like this:

$solrIndex = \Drupal::entityTypeManager()-&gt;getStorage('search_api_index')-&gt;load('global');
$query = $solrIndex-&gt;query();
$query-&gt;addCondition('title', $search_string);

$search_terms = explode(' ', $search_string);

// Don't match items where elements in the title match the stop words
// for an entity.
foreach ($search_terms as $term) {
  $query-&gt;addCondition('field_stop_words', $term, '&lt;&gt;');
}