Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add additional search options, typesense and local search #5489

Merged
merged 5 commits into from
Sep 22, 2021

Conversation

jasonbosco
Copy link
Contributor

Motivation

This PR is a follow-up to #5446 (comment).

The motivation behind this PR is to provide multiple options for a search bar for users, in addition to Algolia. To this end, I've updated the first section of the docs to list out all the options, I've then added a section about Typesense (linking to Typesense's documentation) and another section about local search plugins.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

I've already run this locally to make sure formatting is good, and that all links I added work fine.

Related PRs

None.

@facebook-github-bot
Copy link
Contributor

Hi @jasonbosco!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@jasonbosco
Copy link
Contributor Author

I've signed the CLA

@netlify
Copy link

netlify bot commented Sep 6, 2021

✔️ [V2]

🔨 Explore the source changes: 04c14e1

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/614b48e06e5b34000822c462

😎 Browse the preview: https://deploy-preview-5489--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Sep 6, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 86
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5489--docusaurus-2.netlify.app/

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 6, 2021
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

LGTM 👍

I'd just like to have a mention that we only support Algolia officially so that users don't open us bug reports that we can't solve.

A live Typesense Docusaurus deployment is not required, just a nice to have

- [typesense-docsearch-scraper](https://github.com/typesense/typesense-docsearch-scraper) - which scrapes your website and indexes the data in your Typesense cluster.
- [docusaurus-theme-search-typesense](https://github.com/typesense/docusaurus-theme-search-typesense) - a search bar UI component to add to your website.

### Instructions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this extra section is a bit useless/too much?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it would be helpful to call out that there are two components to this, the scraper and the plugin, so users know that it's not just a plugin.

- [Algolia DocSearch](#using-algolia-docsearch)
- [Typesense DocSearch](#using-typesense-docsearch)
- [Local Search](#using-local-search)
- [Your own `SearchBar` component](#using-your-own-search)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a note that says only the Algolia plugin is official, and the other solutions are maintained/supported by the community, otherwise, we may have users opening Typesense issues in this repo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thank you for adding this!

@@ -182,6 +187,30 @@ If you prefer to edit the Algolia search React component, swizzle the `SearchBar
npm run swizzle @docusaurus/theme-search-algolia SearchBar
```

## Using Typesense DocSearch {#using-typesense-docsearch}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful for users to provide a link to a live Docusaurus site using Typesense in this section, it would help figure out if the end result is good enough before investing any time?

(I'd suggest forking Docusaurus site, replacing the algolia plugin by typesense, and deploying to Netlify + provide live URL and source)

My intuition is that the UI/UX would be similar to Algolia, but can't be sure. For users, it's harder to assess Typesense than Algolia

@slorber
Copy link
Collaborator

slorber commented Sep 22, 2021

As this PR is a bit old (was on holiday 2 weeks 😅 ) I'll fix and merge it now, but feel free to provide a live deployment in the future :)

@slorber
Copy link
Collaborator

slorber commented Sep 22, 2021

Also added some useful things about Algolia that were not very well documented

@slorber slorber merged commit 81877d7 into facebook:main Sep 22, 2021
@slorber slorber added the pr: documentation This PR works on the website or other text documents in the repo. label Sep 22, 2021
@jasonbosco
Copy link
Contributor Author

Thanks for merging this @slorber! Great idea about setting up Typesense DocSearch on a Docusaurus site and including that as an example. I'll create a separate for PR it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants