Search works on the published site. In local preview, run npm run build and then npm run preview to try it.
npm run build
npm run preview