Search

Two ways to implement search.

If you kickstart your documentation from Portal template you'll probably want to implement search. Since we don't provide an implementation for search here are two ways you can implement it.

Fuse.js

Fuse.js is a lightweight, but powerful fuzzy search library that comes as an npm module. Fuse.js can run purely on front-end and doesn't require a server, or any third-party service.

To implement search using Fuse.js you're going to need to add a build step that iterates through your content and builds a search index. The resulting search index is a json file that has to be deployed together with other static files of your Next.js app.

You can use the search index in your front-end code to run fuzzy search on your content. Learn more by exploring Fuse.js documentation.

Algolia

Algolia is a hosted search engine SaaS. You you'll probably want to use Algolia if you have a lot of content and your search index is too large to send over to client-side.

With Algolia, instead of building the search index locally, you're going send your content over to Algolia's search engine via their APIs.

With Algolia you can implement your own search screen and then use their APIs to execute search queries. Or, alternatively, you can use their UI/UX libraries called InstantSearch.

Explore Algolia's docs to learn more.