Skip to content

Do not include headers in search index #3179

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

notriddle
Copy link
Contributor

This significantly shrinks the pre-compressed search index:

$ du -h searchindex-old.js searchindex-new.js
26M	searchindex-old.js
19M	searchindex-new.js

And shrinks the search index even after it's gzipped:

$ du -h searchindex-old.js.gz searchindex-new.js.gz
4.5M	searchindex-old.js.gz
3.3M	searchindex-new.js.gz

This change requires a newer version of mdBook, with rust-lang/mdBook#1637

Screenshots

Before:

image

After:

image

This significantly shrinks the pre-compressed search index:

    $ du -h searchindex-old.js searchindex-new.js
    26M	searchindex-old.js
    19M	searchindex-new.js

And shrinks the search index even after it's gzipped:

    $ du -h searchindex-old.js.gz searchindex-new.js.gz
    4.5M	searchindex-old.js.gz
    3.3M	searchindex-new.js.gz

This change requires a newer version of mdBook, with
rust-lang/mdBook#1637
@notriddle notriddle added the not-rfc For PRs that fix things like spelling mistakes, wrong file names, etc. label Oct 4, 2021
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks! This seems reasonable to me. Since there is such a large number of pages, I think having the search target individual sections probably isn't super useful.

@ehuss ehuss merged commit 899eef7 into rust-lang:master Oct 4, 2021
@notriddle notriddle deleted the notriddle/search-index-smaller branch October 4, 2021 21:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
not-rfc For PRs that fix things like spelling mistakes, wrong file names, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants