Implementing Search for Hugo
- Bleve – Bleve (blevesearch.com) - full-text search and indexing for Go
- Dynamic Search in a Static Hugo Website - Add dynamic search to a static Hugo website with custom templates to generate JSON and JavaScript to parse the results.
- Building Site Search With Hugo
- Add search to Hugo static sites with Lunr - victoria.dev
- Build a Search Bar for Your Hugo Blog With a JSON Index and Some Vanilla JS | zwbetz
- A simple javascript based full text search function
- Luca Ongaro - MiniSearch, a client-side full-text search engine - source of below text
Fuse.js
Fuse.js is optimized for smaller collections of documents: it uses the Bitap algorithm, that provides good fuzzy matching, but iterates through the whole collection of documents upon each search. For this reason it is not ideal for my use case, where Fuse.js incurs in a noticeable delay. Despite this shortcoming, for small collections Fuse.js works quite well and is easy to use.
Lunr.js
Lunr comes with stemming and language support. MiniSearch provides the facilities to add those, but does not provide them out of the box. Stemming and language support are useful features, but they are often not needed, make the library bigger, and can sometimes lead to unexpected results
Lunr index cannot be changed after creation. MiniSearch instead makes it possible to add and remove documents to the index at any moment.
Hugo Fast Search
Fast Hugo search option with:
- Minimal / zero external dependencies (no jQuery)
- Smallest possible size added to each page
- json index only delivered when needed (further minimizing overall impact on page speed / user experience)
- Keyboard friendly, instant navigation