Skip to content

fix(misc): boost CLI command reference search ranking#34625

Merged
barbados-clemens merged 1 commit intomasterfrom
feature/doc-401-investigate-boosting-cli-command-reference-pages-in-search
Feb 27, 2026
Merged

fix(misc): boost CLI command reference search ranking#34625
barbados-clemens merged 1 commit intomasterfrom
feature/doc-401-investigate-boosting-cli-command-reference-pages-in-search

Conversation

@barbados-clemens
Copy link
Copy Markdown
Contributor

@barbados-clemens barbados-clemens commented Feb 26, 2026

Current Behavior

Searching for CLI commands like nx watch on the docs site does not surface the Nx Commands reference page on the first page of results, even when filtering by "References."

Root causes:

  • Term saturation: "nx" appears 150+ times on the CLI reference page (in every heading, usage block, and example), causing it to saturate and contribute almost nothing to ranking differentiation.
  • Page length penalty: The current pageLength: 0.5 setting actively penalizes long pages—the CLI reference is one of the longest on the site.
  • No weight boost: The CLI page had no weight set, while generators/executors pages already get weight: 2.0.

Expected Behavior

Searching for nx watch, nx run-many, or other CLI commands should surface the Nx Commands reference page prominently in results.

This PR applies two quick-win tuning changes:

  1. weight: 4 on the CLI commands page entry — gives body text ~16× impact (quadratic scaling), making it competitive with shorter pages that mention commands incidentally. include the command name in the sub headers for more improvement in relevancy search without impacting other pages
  2. termSaturation: 1.2 (down from default 1.4) — makes highly repeated terms like "nx" saturate faster so that the differentiating term (e.g. "watch") carries more relative weight.

Related Issue(s)

Addresses DOC-401

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 7d4021d
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69a2081c41e8fc0008976cfe
😎 Deploy Preview https://deploy-preview-34625--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 7d4021d
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69a2081cad545d0008f98b3c
😎 Deploy Preview https://deploy-preview-34625--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@barbados-clemens barbados-clemens force-pushed the feature/doc-401-investigate-boosting-cli-command-reference-pages-in-search branch from e97804d to e59d92d Compare February 26, 2026 16:12
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Feb 26, 2026

View your CI Pipeline Execution ↗ for commit 7d4021d

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 8m 10s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 25s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 8s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-27 21:22:25 UTC

@barbados-clemens barbados-clemens force-pushed the feature/doc-401-investigate-boosting-cli-command-reference-pages-in-search branch from e59d92d to 73fa095 Compare February 26, 2026 16:28
Add weight to the CLI commands page and lower term saturation so
that searches like "nx watch" surface the command reference instead
of being buried by shorter pages.

Add command term into the sub headers as well for improved relevancy
boosting
@barbados-clemens barbados-clemens force-pushed the feature/doc-401-investigate-boosting-cli-command-reference-pages-in-search branch from 73fa095 to 7d4021d Compare February 27, 2026 21:09
@barbados-clemens barbados-clemens self-assigned this Feb 27, 2026
@barbados-clemens
Copy link
Copy Markdown
Contributor Author

example of search results w/ changes. (production (left) vs local changes (right)

cli terms that improved
image
image

terms w/ no impact (as expected)
image
image

@barbados-clemens barbados-clemens marked this pull request as ready for review February 27, 2026 21:12
@barbados-clemens barbados-clemens requested a review from a team as a code owner February 27, 2026 21:12
@barbados-clemens barbados-clemens merged commit 7370195 into master Feb 27, 2026
26 checks passed
@barbados-clemens barbados-clemens deleted the feature/doc-401-investigate-boosting-cli-command-reference-pages-in-search branch February 27, 2026 21:33
jaysoo pushed a commit that referenced this pull request Feb 28, 2026
## Current Behavior

Searching for CLI commands like `nx watch` on the docs site does not
surface the [Nx Commands reference
page](https://nx.dev/docs/reference/nx-commands) on the first page of
results, even when filtering by "References."

Root causes:
- **Term saturation**: "nx" appears 150+ times on the CLI reference page
(in every heading, usage block, and example), causing it to saturate and
contribute almost nothing to ranking differentiation.
- **Page length penalty**: The current `pageLength: 0.5` setting
actively penalizes long pages—the CLI reference is one of the longest on
the site.
- **No weight boost**: The CLI page had no `weight` set, while
generators/executors pages already get `weight: 2.0`.

## Expected Behavior

Searching for `nx watch`, `nx run-many`, or other CLI commands should
surface the Nx Commands reference page prominently in results.

This PR applies two quick-win tuning changes:
1. **`weight: 4`** on the CLI commands page entry — gives body text ~16×
impact (quadratic scaling), making it competitive with shorter pages
that mention commands incidentally. include the command name in the sub
headers for more improvement in relevancy search without impacting other
pages
2. **`termSaturation: 1.2`** (down from default 1.4) — makes highly
repeated terms like "nx" saturate faster so that the differentiating
term (e.g. "watch") carries more relative weight.

## Related Issue(s)

Addresses
[DOC-401](https://linear.app/nxdev/issue/DOC-401/investigate-boosting-cli-command-reference-pages-in-search)
FrozenPandaz pushed a commit that referenced this pull request Mar 4, 2026
## Current Behavior

Searching for CLI commands like `nx watch` on the docs site does not
surface the [Nx Commands reference
page](https://nx.dev/docs/reference/nx-commands) on the first page of
results, even when filtering by "References."

Root causes:
- **Term saturation**: "nx" appears 150+ times on the CLI reference page
(in every heading, usage block, and example), causing it to saturate and
contribute almost nothing to ranking differentiation.
- **Page length penalty**: The current `pageLength: 0.5` setting
actively penalizes long pages—the CLI reference is one of the longest on
the site.
- **No weight boost**: The CLI page had no `weight` set, while
generators/executors pages already get `weight: 2.0`.

## Expected Behavior

Searching for `nx watch`, `nx run-many`, or other CLI commands should
surface the Nx Commands reference page prominently in results.

This PR applies two quick-win tuning changes:
1. **`weight: 4`** on the CLI commands page entry — gives body text ~16×
impact (quadratic scaling), making it competitive with shorter pages
that mention commands incidentally. include the command name in the sub
headers for more improvement in relevancy search without impacting other
pages
2. **`termSaturation: 1.2`** (down from default 1.4) — makes highly
repeated terms like "nx" saturate faster so that the differentiating
term (e.g. "watch") carries more relative weight.

## Related Issue(s)

Addresses
[DOC-401](https://linear.app/nxdev/issue/DOC-401/investigate-boosting-cli-command-reference-pages-in-search)

(cherry picked from commit 7370195)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants