chore: nit fix

Signed-off-by: thisisobate <obasiuche62@gmail.com>
This commit is contained in:
thisisobate 2022-11-10 16:11:48 +01:00
parent 1ced4bdc8a
commit 716330c326
1 changed files with 22 additions and 28 deletions

View File

@ -1,68 +1,62 @@
# Best Practices for Documentation Search # Documentation Search
Documentation (docs) search is an important part of developer experience. It makes life so easy for developers by enabling them narrow down to sections theyre looking for in the documentation. Choosing the right tool for docs search can be a hassle. This page describes some common alternatives for static site search.
Here at CNCF,weve explored different search tools and weve decided to narrow our options to this 3: * [Lunr](#lunr)
* [Google search](#programmable-search-engine-by-google)
* [Docsearch by Algolia](#docsearch-by-algolia)
1. Lunr # Docsearch by Algolia
1. Google search
1. Docsearch by Algolia
# Pros And Cons
## Docsearch by Algolia
[DocSearch](https://docsearch.algolia.com/) is a search tool powered by the Algolia search engine that crawls your docs and provides a dropdown search experience on your website. [DocSearch](https://docsearch.algolia.com/) is a search tool powered by the Algolia search engine that crawls your docs and provides a dropdown search experience on your website.
### Pros ## Pros
- Provides Front-end widgets out of the box: search input, dynamic positioning of search results, etc. - Provides Front-end widgets out of the box: search input, dynamic positioning of search results, etc.
- Easy to configure and setup
- Integrations with popular frameworks - Integrations with popular frameworks
- Support for multi-language search. - Support for multi-language search.
### Cons ## Cons
- Search index is completely managed and hosted on Algolia servers - The search index is wholly managed and hosted on Algolia servers
- Hard to customize search - Hard to customize search
- Not entirely free- Limited to 10k records - Not entirely free- Limited to 10k records
- Limited access to features. - Limited access to features.
## Programmable Search Engine by Google # Programmable Search Engine by Google
[Googles programmable search engine](https://developers.google.com/custom-search/docs/overview) is a search tool that crawls your **live site** and renders results on your website. [Googles programmable search engine](https://developers.google.com/custom-search/docs/overview) is a search tool that crawls your **live site** and renders results on your website.
### Pros ## Pros
- Easy to configure and setup - Easy to configure and setup
- Multi-language support - Multi-language support
- Support for image search - Support for image search
- Search across a specified collection of sites or pages - Search across a specified collection of sites or pages
- No daily limits for query or records. - No daily limits for queries or records.
### Cons ## Cons
- Google search [does not work in various countries](https://techcrunch.com/2010/04/19/google-censorship/). - Google search [does not work in various countries](https://www.makeuseof.com/countries-google-doesnt-dominate/).
- Shows ads in between search results - Shows ads in between search results
- Works only on deployed, production version of your site - Works only on deployed, production version of your site
- Hard to customize - Hard to customize
- Search index is completely managed and hosted on Google servers. - Search index is completely managed and hosted on Google servers.
## Lunr # Lunr
[Lunr.js](https://lunrjs.com/) is a small, full-text search library for use in the browser. Lunr enables you to provide a great search experience without the need for external, server-side, search services. [Lunr.js](https://lunrjs.com/) is a small, full-text search library for use in the browser. Lunr enables you to provide a great search experience without needing external, server-side, search services.
### Pros ## Pros
- Support for offline search - Support for offline search
- No external package dependency - No external package dependency
- Completely free and open source - Completely free and open source
- Full power for customization - Full power for customization
- Support for multi-language search
- Search index is completely managed and hosted by the owner. - Search index is completely managed and hosted by the owner.
### Cons ## Cons
- Can be difficult to configure and setup (If a team is already using hugo/docsy, this should be *very* easy to setup). - Can be difficult to configure and setup (If a team is already using hugo/docsy, this should be *very* easy to setup).
- Requires javascript knowledge - Depending on site setup, may require javascript knowledge
# When Is It Best To Use One Over Another? # When Is It Best To Use One Over Another?
If you are looking to create a search capability for your open source project without having to depend on a 3rd party service, then you should consider using [Lunr](https://lunrjs.com/). You can take a look at [this](https://github.com/vitessio/website/pull/1119) pull request to see how we used Lunr to implement search in Vitess docs website. If you are looking to create a search capability for your open source project without having to depend on a 3rd party service, then you should consider using [Lunr](https://lunrjs.com/). You can take a look at [this custom implementation](https://github.com/vitessio/website/pull/1119) or [Hugo/Docsy implementation](https://github.com/etcd-io/website/pull/403) to see the different ways we used Lunr to implement search.
If you are looking to setup search without caring too much about cost, customization, and 3rd party dependency, then you should consider going for [Docsearch by Algolia](https://docsearch.algolia.com/). If you are looking to create a search engine that not only focuses on the contents of one website (site search), but on a particular topic from multiple sites, then you should consider the [Programmable Search Engine (Google search)](https://developers.google.com/custom-search/docs/overview).
If you are looking to create a search for documentation irrespective of where its hosted (separate site), then you should consider the [Programmable Search Engine (Google search)](https://developers.google.com/custom-search/docs/overview).