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

Add meilisearch for docs search #726

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

kprosise
Copy link
Contributor

Added search functionality.

Two api keys are exposed, with limited scope.
The search api, which is normal and required for basic search functionality.
An additional key allows for getting the list of indexes. This allows for checking if an index matching the release exists.

If no index exists, the default doc search is used.

Known issues: as a limit to the number of indexes/releases will eventually present itself, older indexes will need to be deleted. As Sphinx is static, this presents a bit of an issue. However, once version selection is implemented, older versions will be rebuilt, meaning older releases with deleted search indexes will fallback to using the default Sphinx search.

Additionally, local/PR CI builds will use a "dev" index. This will eventually be configured to use the most recent commit, however for now the index was created by scrapping "latest".

Note this commit does NOT cover the creation of indexes, which at this time will be handled manually, and requires private keys.

QA: Checked rendered output, and tested a number of cases by modifying the variables used.

This commit addresses task FFTK-3215
This commit applies to task FFTK-3091

PR Template and Checklist

Please complete as much as possible to speed up the reviewing process.

Readiness and adding reviewers as appropriate is required.

All PRs should be reviewed by a technical writer/documentation team and a peer.
If effecting customers—which is a majority of content changes—a member of Customer Success must also review.

Readiness

  • Merge (pending reviews)
  • Merge after date or event
  • Draft

Overview

DOC SEARCH

Checklist

  • Avoid changing any header associated with a link/reference.
  • Step through instructions (or ask someone to do so).
  • Match tone and style of page/section.
  • Run make linkcheck.
  • View HTML in a browser to check rendering.
  • Use semantic newlines.
  • follow best practices for commits.
    • Descriptive title written in the imperative.
    • Include brief overview of QA steps taken.
    • Mention any related issues numbers.
    • End message with sign off/DCO line (-s, --signoff).
    • Sign commit with your gpg key (-S, --gpg-sign).
    • Squash commits if needed.
  • Request PR review by a technical writer and at least one peer.

Comments

Additional styling and configuration will be added in the future.
I also do not do Python, so code in conf.py is not optimized or pretty in anyway.

@doanac
Copy link
Member

doanac commented Jul 17, 2024

Copy link
Member

@MiloCasagrande MiloCasagrande left a comment

Choose a reason for hiding this comment

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

How would meilisearch work in development mode locally? Since the docs are public, I suppose we want to limit its use only to us, not to external contributors.

Can it be disabled and default to old-search for local dev?

source/conf.py Outdated Show resolved Hide resolved
source/_templates/searchbox.html Outdated Show resolved Hide resolved
@kprosise
Copy link
Contributor Author

How would meilisearch work in development mode locally? Since the docs are public, I suppose we want to limit its use only to us, not to external contributors.

Can it be disabled and default to old-search for local dev?
dev currently just uses results from "latest" rather than actual results. And yes, I will include a comment in conf.py for switching it to use default.

Added search functionality.

Two api keys are exposed, with limited scope.
The search api, which is normal and required for basic search
functionality.
An additional key allows for getting the list of indexes.
This allows for checking if an index matching the release exists.

If no index exists, the default doc search is used.

Known issues: as a limit to the number of indexes/releases will
eventually present itself, older indexes will need to be deleted.
As Sphinx is static, this presents a bit of an issue.
However, once version selection is implemented, older versions will be rebuilt,
meaning older releases with deleted search indexes will fallback to
using the default Sphinx search.

Additionally, local/PR CI builds will use a "dev" index.
This will eventually be configured to use the most recent commit,
however for now the index was created by scrapping "latest".

Note this commit does NOT cover the creation of indexes, which at this
time will be handled manually, and requires private keys.

QA: Checked rendered output, and tested a number of cases by modifying
the variables used.

This commit addresses task FFTK-3215
This commit applies to task FFTK-3091

Signed-off-by: Katrina Prosise <[email protected]>
@doanac
Copy link
Member

doanac commented Jul 18, 2024

Copy link
Member

@MiloCasagrande MiloCasagrande left a comment

Choose a reason for hiding this comment

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

Thanks Katrina! All good to me!

@kprosise kprosise merged commit 2b3c584 into foundriesio:main Jul 18, 2024
2 of 3 checks passed
@kprosise kprosise deleted the add-meilisearch branch July 18, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants