[beta] Doc search backports
This is a backport of #46081, #46175, #46433, and #46672. They all merged cleanly but I haven't tried a build; let's see what Travis says.
These PRs fix pretty annoying issues with doc search and so I think it's important they don't slip to stable, but these PRs have *NOT* been `beta-accepted` yet.
cc @steveklabnik@GuillaumeGomez can you tag the docs team to talk about beta-acceptance?