Full-text search in JavaScript

First we need to make available a searchable JSON document.

It can probably be normalised to relatively plain text before being converted into a search index.

The search index is a structure that incorporates language specific search features like stemming, phonetic similarity and other helpful things.

After reading a bit about solutions like elsasticlunr, lunr, fuse and flexsearch, it seems like the latter, flexsearch is the fastest current alternative (2021-07).

https://github.com/nextapps-de/flexsearch#docs

It allows us to add all our documents to the index, then export the index into a static file that could be loaded client side.

I imagine building the index during the build step and serving it as a highly cached static file that can be loaded on the client.

My goal is to have a fast and good search for my knowledge base in the client.

The website used as a navigation environment for the knowledge base is per now (2021-07) a static htnl website. No client side react or similar.

See also full text search using built-in types in Postgres > 12 https://blog.crunchydata.com/blog/postgres-full-text-search-a-search-engine-in-a-database

See Interaction design, List of navigation patterns, search