Apply multiple Content Type filters to Search Block Form in hook_form_alter() I'm trying to figure out how to apply multiple content type filters to the search results of the Search Block Form (not the normal search form). I've successfully filtered by current language and ONE content type. So far, here's what I have:

function mytheme_form_search_block_form_alter(&amp;$form, &amp;$form_state) {
  $manager = \Drupal::languageManager();

  $form['advanced-form'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 1,
  ];
  $form['f[0]'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 'language:' . $manager-&gt;getCurrentLanguage()-&gt;getId(),
  ];
  $form['f[1]'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 'type:Insight',
  ];
}


There doesn't appear to be any documentation about adding filters this way. But I did find this: NodeSearch::buildSearchUrlQuery. It appears that one should somehow be able to use OR and Negation in this, but I just can't figure it out.

I've tried this:

$form['f[1]'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 'type:Insight OR type:Event',
];


This just filters by the last one listed. I also tried this:

$form['f[1]'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 'type:Insight OR Event',
];


And this:

$form['f[1]'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 'type:["Insight","Event"]',
];


And none of these were working to filter in (or out) multiple content types.

Any help would be greatly appreciated. Or just pointing me to some documentation on using filters this way. Thanks.
So, I figured out how to make it work without actually finding any documentation. I just added a new filter for each content type I want to search:

$form['advanced-form'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 1,
];
// add filter for current language
$form['f[0]'] = [
    '#type' =&gt; 'hidden',
    '#value' =&gt; 'language:' . \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getId(),
];
// add filter for each full-page content type
foreach (fullPageNodeList() as $key =&gt; $full_page_type) {
    $form['f['.($key + 1).']'] = [
        '#type' =&gt; 'hidden',
        '#value' =&gt; 'type:'.$full_page_type
    ];
}