Conversation
acd5357 to
5f988c4
Compare
5f988c4 to
5a2a365
Compare
| @@ -0,0 +1,208 @@ | |||
| import React, {useState, useRef, useCallback, useMemo} from 'react'; | |||
There was a problem hiding this comment.
Note that this file was "swizzled" from a Docusaurus core class, because there doesn't seem to be any other way to create context-aware search rankings. For the actual change we made to the docusaurus core class, see 5a2a365
| ) | ||
| .last() | ||
| .text() || "Documentation"; | ||
| $(".navbar__item.navbar__link--active").last().text() || |
There was a problem hiding this comment.
The menu selector that came with the default setup was doing really weird things, and we prefer to just use "For users" vs "For contributors" as the lvl0 of the hierarchy so that we can use it for search faceting, eg to downrank contributor docs when viewing user docs and vice-versa
| const isApi = $(".menu__link.menu__link--active") | ||
| .toArray() | ||
| .some((element) => $(element).text() === "API") | ||
| ? "yes" | ||
| : "no"; |
There was a problem hiding this comment.
This allows us to down-rank api docs
| defaultValue: lvl0, | ||
| }, | ||
| lvl1: "header h1", | ||
| lvl1: "article h1", |
There was a problem hiding this comment.
For some reason the default selector here was buggy, and only worked if title was defined in frontmatter, not when it was just an h1 tag, as is the case for most of our docs
| @@ -0,0 +1,129 @@ | |||
| new Crawler({ | |||
There was a problem hiding this comment.
Note that this file was dumped from the search console after a bit of tweaking to improve rankings. To see the actual changes made, see b37cd1
61c571a to
b834829
Compare
b834829 to
d4d1fe2
Compare
Tweaks docs search so that we
Note that this PR "swizzles" a Docusaurus core class, because there doesn't seem to be any other way to create context-aware search rankings. For the actual change we made to the docusaurus core class, see
5a2a365. Note that we would like to un-swizzle the component so that we can un-pin Docusaurus; see #931This PR also captures the crawler / index settings that live in the Algolia console today. See #917 for how we plan to make the files in source control the source of truth in the future. You can see the actual changes that were made in the search console to improve search ranking in
b37cd16To try out the new search rankings, pop up the search widget in the deploy preview at https://deploy-preview-915--cursorless.netlify.app/docs/
Fixes #644
Before
After
Checklist