Skip to content

How to make my custom module add pages to the site search?

My custom Magento 2 module has pages like:

/mymodule/page/page/testpage

And some text on that page. I want to add to Magento’s site search index so if I search for “testpage” for example, it shows a link to that URL. How do I make my custom module add to Magento’s site search?