A WebSite schema with a SearchAction enables sitelinks search boxes and signals to engines that your site has an internal search worth using to answer related queries.
Add a WebSite schema block (usually on your homepage) with a "potentialAction" of type SearchAction pointing at your internal search URL pattern.