Skip to content

API search: leave the unreleased /next tree out of the index - #4972

Merged
reakaleek merged 4 commits into
mainfrom
api-search-newest-major-a87d70da
Nov 20, 2026
Merged

reakaleek merged 4 commits into
mainfrom
api-search-newest-major-a87d70da

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The search index no longer holds main at /api/<key>/next. Search and llms.txt point at the newest major at the versionless URL, and at older majors under /vN.

Affects: Search, API reference

Prompt summary: Implement elastic/docs-eng-team#1215. Point API search defaults and llms.txt at the newest major. Index the newest major at versionless URLs and older majors at /vN. Index neither next nor the /vN copy of the newest major.

Why

#4971 made the newest major the default tree and moved main to /next. The export still indexed main, so documents with /next URLs sat in the index. They were hidden, but they were still there. The llms.txt hub already links the versionless URL.

Closes elastic/docs-eng-team#1215

What

The index stops carrying /next

The search export skips the main tree when a numbered major is the default. An API with no numbered major keeps main at its versionless URL. main must still load, so a broken main spec still stops the export instead of deleting documents. ApiVersionRoutes.IsNext names the rule.

Search from a /next page

A /next page sends only api_key, because no main documents remain to scope to. Search there is the normal search with a lift for that API's default-version results. It does not filter by version.

Tests and docs

Exporter tests cover the URL set for a main, 9, 8 fixture. No path contains /next or /v9. A catalog test expects exactly /docs/api/elasticsearch for the link that feeds llms.txt. Another test checks that a failing main spec still stops the export while 9 loads. The API explorer page states the indexing rule.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
mise run site:test

Notes

  • ApiTreeCollapse already drops the /v9 copy of the newest major. This PR adds only the /next exclusion.
  • I did not index-check against the dev cluster. The fixture tests cover the URL set.

🤖 Generated with Claude Code

The search index now holds the newest major at the versionless URL and older majors at `/vN`. It no longer holds `main` at `/next`. A search from a `/next` page sends only `api_key`, because no `main` documents remain to scope to.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 20, 2026 00:37
@reakaleek
reakaleek requested a review from akira28 November 20, 2026 00:37
Comment thread docs/data/openapi/api-explorer.md Resolved
| `main` | `/api/<key>/next/` | Unreleased spec |

The numeric `9` entry is a frozen v9 snapshot. It is distinct from the moving `main` entry.
Search indexes the default version at `/api/<key>/` and older majors at `/api/<key>/vN/`, not `main` at `/next/` or the `/v9/` copy of the newest major. Search from a `/next/` page is the normal search with a lift for that API's default-version results. It does not filter by version, and operations that exist only in older majors stay hidden.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Qualify the /next/ search boost as behavior of Elasticsearch-backed search. Isolated builds use Pagefind without sending the API key, so readers there will not get the promised boost for that API’s default-version results.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit a8155cb into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the api-search-newest-major-a87d70da branch November 20, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant