Easy and flexible client-side search for static sites.
InfiSearch is a client-side search solution made for static sites, depending on a pre-built index generated by a CLI tool.
- Relevant Search 🔍: spelling correction, automatic prefix search, boolean and phrase queries, BM25 scoring, proximity scoring, facet filters and more...
- Speedy 🏇: WebAssembly & WebWorker powered, enabling efficient, non-blocking query processing. Backed by persistent caching to minimize network requests, and a multi-threaded CLI indexer.
- Semi-Scalable, achieved by optionally splitting the index into tiny morsels, complete with incremental indexing.
- A customisable, accessible user interface 🖥️
- Support for multiple file formats (
.json,csv,pdf,html) to satisfy more custom data requirements.
The documentation, which uses InfiSearch for its search function, can be found here.
Some demos of InfiSearch on a much larger Gutenberg collection are also available here.
Powering static site search with InfiSearch is extremely easy, and requires just a folder of your HTML files — titles, headings, and other text are automatically extracted. Links to your pages are automatically generated based on your folder structure, but can also be manually specified.
1. Installing the indexer
There are a couple of options for installing the indexer:
- Install the global npm package with
npm install -g @infisearch/cli.
- If you have the rust / cargo toolchains setup, run
cargo install infisearch --vers 0.10.1.
- You can also grab the cli binaries here.
2. Running the indexer
Run the executable as such, replacing
<source-folder-path> with the relative or absolute folder path of your source html files, and
<output-folder-path> with your desired index output folder.
infisearch <source-folder-path> <output-folder-path>
3. Installing the Search UI via CDN
Add the following resources to your pages:
<!-- Search UI script --> <!-- Search UI css, this provides some basic styling for the search dropdown, and can be omitted if desired -->
If you wish to host the files, you can find them in the
<output-folder-path>/assets directory generated by the indexer, or in the releases page.
4. UI Initialisation
<input> element in your page an
infi-search, then call:
This project is MIT licensed.