Search api, postprocess processor: how re-run the query?
I managed to do something, despite not being optimal: in the postprocessSearchResults when necessary I send a RedirectResponse with new search params thus &quot;reloading&quot; the page and &quot;re-running the search.
  /**
 *
 * @SearchApiProcessor(
 *   id = &quot;my_processor&quot;,
 *   label = @Translation(&quot;A label&quot;),
 *   description = @Translation(&quot;A description&quot;),
 *
 *   stages = {
 *     &quot;postprocess_query&quot; = 0,
 *   }
 * )
 */
class MyProcessor extends ProcessorPluginBase {

  //Skipped constructor and boilerplate code

  /**
   * {@inheritdoc}
   */
  public function postprocessSearchResults(ResultSetInterface $results) {
    if ($results-&gt;getResultCount()) {
      return;
    }

    $query = $results-&gt;getQuery();

    if ($query-&gt;getProcessingLevel() != QueryInterface::PROCESSING_FULL) {
      return;
    }

    $request = $this-&gt;requestStack-&gt;getMasterRequest();
    $request_query = $request-&gt;query;
    $sdm_empty_result_automatic_search = $request_query-&gt;has($this-&gt;requestQueryTag) ? $request_query-&gt;get($this-&gt;requestQueryTag) : FALSE;

    /*
     * Necessary to identify between user search and ones run by this class.
     * E.g. if the user is on &quot;article&quot;, and does a new search, it must stay
     * on &quot;articles&quot; if there is any result.
     * However if there are no results, the class must redirect to the fist
     * content type and so on until all are searched
     *
     */
    $next_type_value = NULL;
    $condition_type_value = $this-&gt;sdmSearchQueryHelper-&gt;queryGetConditionValue($query);
    switch ($condition_type_value) {
      case 'prodotto':
        $next_type_value = 'scheda_espositore';
        $sdm_empty_result_automatic_search = TRUE;
        break;
      case 'scheda_espositore':
        $next_type_value = $sdm_empty_result_automatic_search ? 'article' : 'prodotto';
        break;
      case 'article':
        $next_type_value = $sdm_empty_result_automatic_search ? NULL : 'prodotto';
        break;
    }

    if (empty($next_type_value)) {
      return;
    }

    $query_params = [
      'search_api_fulltext' =&gt; $query-&gt;getOriginalKeys(),
      'sort_by' =&gt; 'title',
      'f' =&gt; ['content_type:' . $next_type_value],
    ];

    if ($sdm_empty_result_automatic_search) {
      $query_params[$this-&gt;requestQueryTag] = $this-&gt;requestQueryTag;
    }

    $response = new RedirectResponse(Url::fromRoute('&lt;current&gt;', [], ['query' =&gt; $query_params])
      -&gt;toString());
    $response-&gt;send();

     /**
     * todo
     * can't use the following logic but had to do all the previous because I have overriden the default url_processor,
     * so there is always a &quot;default&quot; content type if none is selected.
      * So unfortunately I can't run a generic query to search for all the results.
      * For a &quot;standard&quot; search implementation the following one could be a good starting point
     */
    /*
    $original_query = $query-&gt;getOriginalQuery();
    $original_query-&gt;addTag($this-&gt;queryTag);
    $this-&gt;sdmSearchQueryHelper-&gt;addConditionToQuery($original_query, 'facet:type', ['type' =&gt; 'scheda_espositore']);
    $results = $original_query-&gt;execute();

    $items = $results-&gt;getResultItems();
    $iterator = $results-&gt;getIterator();
    */

  }