Skip to content

(CONTRIBUTING.md) update explanation of the keywords prop for search #2154

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ These fields should be present on every documentation page.

The `search` frontmatter field can be used to control how a page is indexed by [Algolia Crawler](https://www.algolia.com/doc/tools/crawler/getting-started/overview/). It has the following subfields:

| Name | Type | Default | Description |
| ---------- | --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exclude` | `boolean` | `false` | Whether to exclude the page from search entirely |
| `rank` | `number` | `0` | The value to use for `weight.pageRank` in the index. See [Custom Ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/) and [Boost search results with `pageRank`](https://docsearch.algolia.com/docs/record-extractor/#boost-search-results-with-pagerank) |
| `keywords` | `Array<string>` | `[]` | Additional [searchable](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/) keywords to include when indexing the page. These are not visible to users. |
| Name | Type | Default | Description |
| ---------- | --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exclude` | `boolean` | `false` | Whether to exclude the page from search entirely |
| `rank` | `number` | `0` | The value to use for `weight.pageRank` in the index. See [Custom Ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/) and [Boost search results with `pageRank`](https://docsearch.algolia.com/docs/record-extractor/#boost-search-results-with-pagerank) |
| `keywords` | `Array<string>` | `[]` | Additional [searchable](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/) keywords to include when indexing the page. These are not visible to users. Due to Clerk's Algolia configuration, keywords have superiority over all other attributes; setting a keyword will rank that page higher than any other page. For example, the keyword "allowlist" is set on the [`restrictions.mdx`](/docs/authentication/configuration/restrictions.mdx) page so when searching for "allowlist", this page will be ranked above any other page. |

You may also set `search` to a boolean value, which acts as an `exclude` value. See the first example below.

Expand All @@ -251,6 +251,16 @@ You may also set `search` to a boolean value, which acts as an `exclude` value.
---
```

or

```diff
---
title: Example
+ search:
+ exclude: true
---
```

</details>

<details>
Expand Down