-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 support for Mkdocs search #6937
Conversation
To make the search available to all projects, we need to trigger a build or crawl all mkdocs projects (and versions) on storage and copy it's |
@stsewd I wonder if it makes more sense to just read the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good change. I'd like to:
- Remove the json builder, so we can automatically reindex all existing mkdocs projects. It isn't needed, I don't think?
- Start by indexing the files first, so that our site search works, but we don't override the in-doc search results quite yet. This will let us roll this out in a nice staged way instead of breaking all mkdocs projects.
- Probably add a way to opt out of our search for mkdocs users as well
function init() { | ||
var data = rtddata.get(); | ||
attach_elastic_search_query(data); | ||
if (data.builder === 'mkdocs') { | ||
attach_elastic_search_query_mkdocs(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scares me a little bit, overwriting the users search content. Can we ship the indexing code and let it settle in before we try overriding the actual results for users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can revert the js change and put it in another PR respecting the "skip search" flag.
Don't inject our search just yet
Changed to index directly from the html artifacts in storage and reverted the js changes, this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 👍 on this change. It should let us start indexing data and make site search work, and we can then integrate it into the docs once we confirm that all works. 🎉
Closes #1088
Related to #4588
Things to do:
Override the search js with ours to call ESCache the processed index file per projectAdd testsBut currently is working if someone wants to test it :)