Search and comments are the casualties of static-sites - unless you bow and crumble to the use of something 3rd party (Disqus or Google Site Search to name some poor examples)
staticman[0] for comments is a neat solution that avoids those surveillance companies. it can use heroku hobby tier for processing and github as the content backend for a free, hosted comments solution for static sites (fully acknowledging that heroku and github are both owned by other surveillers).
For a lot of situations something like jekyll search [0] works wonders. It basically generates a json file (you can customize it quite a bit). For even decently sized blogs it's quite quick and doesn't require a page refresh.
Can’t speak for GP, but I have a static site written in Gatsby. Yes (prepares boring-to-mention downvote armor) it is absolutely riddled with JavaScript. But if you want the ability to “search” without having a backend, Gatsby can do that.
But they assume some context, which I’ll give you: At compile time, Gatsby is capable of making a list of all the posts on your site that you can query with GraphQL (at compile time) or use in the JS of your pages. In fact, saying it makes a list of all “posts” is selling it short, because Gatsby can store and manipulate arbitrary data structures. So if you’ve got a Documentation site with a table of contents and three levels of content within it... that’s all queryable at compile time too. It’s extremely flexible.
Now, it’s not like your pages will actually be using GraphQL to query a DB when the user arrives on the page: all the data is basically “baked in” to the page when it is compiled. But for a static site where the “data” only changes when you add/change some content and recompile, this works really well.