Display Search Block in template DRUPAL 8 VERSION 

Hi i am trying to display the search block in a custom view named as menu--main.html.twig. Below is the code in my theme function

function bootstrap_preprocess_page(&amp;$variables) {
  $block = \Drupal\block\Entity\Block::load('bootstrap_search'); 
  $variables['block_search_form'] = \Drupal::entityTypeManager()
    -&gt;getViewBuilder('block')
    -&gt;view($block);
}


I am able to display the search block in page.html.twig. But i want to display the block in menu--main.html.twig Can someone guide me how can i achieve this?
I was using the wrong hook as suggested by kevin. The hook to be used there was bootstrap_preprocess_menu__main .... It all became cleared after reading this comment https://api.drupal.org/comment/62602#comment-62602