What is FlexSearch
FlexSearch is a superb, browser-based search engine. It supports a non-blocking asynchronous processing model using Web workers and works great with Svelte/Vue/React and static site builders like Eleventy and Gatsby. It provides the search engine for the blog you're reading.
The notion of an effective browser-based search engine is a little eye-brow raising. Your truly have to see FlexSearch in action to believe what it is—it is highly performant. And for many, many Web sites, it's a worthy alternative to Algolia, ElasticSearch, and TypeSense.
This article talks about creating a single FlexSearch index. However, if its prudent for your application, FlexSearch supports multiple indexes.
A FlexSearch index is created, in realtime, when a page is loaded. You're in control of exactly when this happens; it needs to be done before a user can search something. This index is created from an array of JavaScript objects that provide the indexing information. I know it sounds a little nutty, but FlexSearch's indication is lightning fast. Don't get judgy about it until you see it in action. It is very well suited for small- and medium-sized projects.