boosting doc

Signed-off-by: DanRoscigno <dan@roscigno.com>
This commit is contained in:
DanRoscigno 2025-04-17 07:55:39 -04:00
parent c8aaa1fa7a
commit 6279bbcca6
No known key found for this signature in database
GPG key ID: 173762EABBD1ACE4
3 changed files with 11 additions and 4 deletions

View file

@ -38,6 +38,7 @@ title: Page name
## Overview
```
## Configure the Algolia index
Each Algolia index has several configuration options. The section to configure for page boosting is **Index****Configuration****Relevance Essentials****Ranking and Sorting** → **Custom Ranking**
@ -67,7 +68,7 @@ recordExtractor: ({ $, helpers }) => {
### Extract the `pageBoost` metadata
Within the `recordExtractor` function add the highlighted line to extract the `pageBoost` metadata into `const pageBoost`, with a default value of 0 if no metadata is present in the page.
Within the `recordExtractor` function, add the highlighted line to extract the `pageBoost` metadata into `const pageBoost`, with a default value of 0 if no metadata is present in the page.
```js
recordExtractor: ({ $, helpers }) => {
@ -96,11 +97,17 @@ return helpers.docsearch({
## Testing
![Algolia test URL records](/img/boost/boost_algolia_test_url_records.png)
![Algolia search UI page rank](/img/boost/boost_algolia_page_rank_search_ui.png)
1. To test the changes to the page metadata and the Algolia Crawler build and publish your Docusaurus site.
1. View the source of a modified page and check for the added `pageBoost` metadata. It should look like this (with the content you assigned) in the HTML:
```html
<meta data-rh="true" name="pageBoost" content="100">
```
1. Open the Crawler UI and test one of the pages you are boosting. Access the crawler editor from the Algolia dashboard for your Algolia application at **Data sources****Crawler** by choosing the name of the crawler, and then **Editor**. In the top navigation select **URL Tester** and test a boosted page, verify that `weight.pageRank` is set in the **Records** tab:
![Algolia test URL records](/img/boost/boost_algolia_test_url_records.png)
## Production
Run a production crawl after testing individual URLs and confirm the updated search results.
## More information

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Before After
Before After