Direct query with Search API Solr I am new to Drupal. I'm trying to implement advanced search on my Drupal8 website. It's working perfectly with the logical operator 'OR' and 'AND' but not with 'NOT', '+', '-'.

Here is my request :

$index = \Drupal\search_api\Entity\Index::load('videos_full');
    $query = $index-&gt;query();
    $parse_mode = \Drupal::service('plugin.manager.search_api.parse_mode')
                  -&gt;createInstance('direct');
    $query-&gt;setParseMode($parse_mode);
    $query-&gt;addCondition('search_api_language', \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getId());
    $query-&gt;addCondition("status",5);

    $query-&gt;setFulltextFields(['field_title', 'title', 'resourcetype', 'tag', 'choreographer', 'director', 'producer', 'structure', 'contributor', 'secondaryauthor']);
    $query-&gt;keys($search);

    $query-&gt;sort('created','DESC');
    $results = $query-&gt;execute();


Thank you for your help !
Please refer to following Drupal documentation example for advanced configuration of search query:

https://www.drupal.org/docs/8/modules/search-api/developer-documentation/executing-a-search-in-code

$query->keys($search);

'+', '-' works by default in $search(searched keyword)