Is there any function equivalent to the (D7) search_data() in Drupal 8? I would like to get the search results as a renderable array or html for a given keyword programatically.
In D8, the SearchController.php provides the view which does the same, but I'm not sure how to call that from my module?
$plugin = $entity->getPlugin(); $plugin->setSearch(); $plugin->buildResults();
to get the result.
How do I create the SearchPageInterface entity which contain the getPlugin() method? Or is there a way to create an instance of the default search plugin directly?
My requirement is to show the search results in a custom page where the search results are wrapped by the custom page content. I've implemented this in D7 using search_data function. How can I achieve similar result in D8?