From its repo: "Pagefind runs after any static site generator and automatically indexes the built static files. Pagefind then outputs a static search bundle to your website, and exposes a JavaScript search API that can be used anywhere on your site."
I don’t want to force JavaScript onto my users and wrote my own full-text search for Hugo that is skinned with your Hugo theme for a seamless look (only the URL changes):