Repository navigation
API search: add a / key chip and a larger landing page box - #4565
Merged
Merged
Conversation
The placeholder `Type ❲/❳ to explore API` becomes `Explore API`. A small key chip at the right edge of the input advertises the `/` shortcut and hides once the input has focus or text. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
akira28
approved these changes
Oct 23, 2026
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4565/ |
Member
Author
The landing page hero reused the compact sidebar input. A new `hero` variant of `<navigation-search>` renders a 46px box with a softer shadow and the placeholder `Search every API operation`. The sidebar box is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rch boxes Both boxes run the same search, so they share one placeholder. This also drops the hero-only placeholder, which said "Search" next to the site header search. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The search covers every Elastic API and the landing page is titled "Elastic APIs", so the placeholder and accessible name use the plural. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The landing page renders `<navigation-search variant="hero">`, so the catalog test asserts that tag instead of the sidebar one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
reakaleek
added a commit
that referenced
this pull request
Nov 3, 2026
Main replaced Jest with Vitest in [#4588](#4588) while this branch was open, so `tsc` no longer knows the `jest` global and the `npm` CI job failed. The tests now use `vi.fn`, and the file-level `htmx.org` mock goes away because `setupTests.ts` already mocks it for every file. The property navigation test also looks for the "Explore APIs" placeholder that [#4565](#4565) introduced. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
reakaleek
added a commit
that referenced
this pull request
Nov 3, 2026
* Add API property search with direct links to matching fields Co-Authored-By: GPT-6 <noreply@anthropic.com> * Move the API property search tests to Vitest Main replaced Jest with Vitest in [#4588](#4588) while this branch was open, so `tsc` no longer knows the `jest` global and the `npm` CI job failed. The tests now use `vi.fn`, and the file-level `htmx.org` mock goes away because `setupTests.ts` already mocks it for every file. The property navigation test also looks for the "Explore APIs" placeholder that [#4565](#4565) introduced. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Name the Enter action after its destination in API search "Jump to API" no longer says where Enter leads once a result box holds an operation and its matching fields. An operation row now says "Go to operation", a property row says "Go to property", and a docs page keeps "Jump to". The dropdown footer shows the label of the selected row, so the hint changes as the arrow keys move between an operation and its properties. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Keep the footer's Enter hint static as "Go to page" A footer label that changes with the selected row draws the eye on every arrow press. The footer now always says "Go to page", and a docs page row uses the same words so one action has one name. Operation and property rows keep "Go to operation" and "Go to property". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Align the property row's Enter badge with the operation row's The operation row insets its "Go to operation" badge 24px from the box edge while the property row insets "Go to property" 16px, so the two badges did not line up. The property row now uses the same right padding as the operation row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Pin property search behaviours before simplifying These tests hold the contract steady for a refactor. The result processor keeps the three best-scoring properties with distinct anchors in score order. The navigation service links a property to its anchor on the operation page. The document hash changes when a property is added or its path changes, through a pure `DocumentHash` split out of `AssignDocumentMetadata`. A property row shows its location only when the same path appears in two locations, and the mouse selects a property row unless the keyboard is driving. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Simplify property search without changing what it does Results are grouped once, in `groupSearchResults`, which numbers the operation and its properties in keyboard order and decides where a location chip is needed. The list only renders those groups, the dropdown loses a one-caller wrapper, both row kinds share one click telemetry path, and the Enter badge owns its own show-on-select rule. The match tint lives in one `--search-highlight-tint` token that the two result lists and the property flash all read. The anchor telemetry attribute joins its siblings in `semconv.ts`, and the modal search drops a `properties` field it never read. On the server, the query builder parses the input once and reads the nested field names from `QueryFieldNames`, the property walk is a single pre-order `SelectMany`, and plain-text descriptions are cached per spec so shared schemas are converted once per indexing run instead of once per operation. Verified against the same cluster: all 18 captured navigation-search responses are byte-identical before and after, and the headless run on localhost:4001 passes every functional check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Show the primary route of a path hit in API search results A query such as `_search` matched an operation's path, but the result only showed the match buried in the body snippet after "Method: POST Path:". The index now stores each operation's routes with their methods, taken from the same endpoint rows the operation page renders, and the navigation search returns them. When a query word names a path, the result replaces the description with the primary route: the method the page leads with and the path with the match highlighted. An alternate route takes its place only when the primary one does not contain the word, so the hit is always explained without listing every variant. The autocomplete source filter now returns every required member of the api object, since a hit that carries any part of it must deserialize, and a test pins that rule. The mapping update sends the whole api object so the existing semantic index gains the field. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Show the route a query names in full over the primary route Typing `/_search` showed `POST /{index}/_search`, the page's primary route, which left the reader checking whether that was the route they meant. A route whose whole path is a query word now wins, so `/_search` and `_search` show `POST /_search`, while `search` or `index` still show the primary route that contains them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Read a combined API query in either word order A combined query took its last word as the field and the rest as the endpoint, so `knn /_search` looked for a field named `/_search` and returned the operation without its `knn` rows, while `knn search` surfaced an unrelated operation whose fields contain "search". The field is now the last word that cannot be part of an endpoint, one that neither starts with a slash nor is an HTTP method, and the endpoint is everything else in order. `knn /_search`, `/_search knn` and `knn GET /_search` read the same. A query made only of endpoint words skips the field branch instead of searching for a field named after the path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Let the index decide which word of a two-word API query is the field Without a slash or a method word nothing marks the endpoint in a two-word query, so `knn search` took `search` as the field and surfaced an unrelated operation. Such a query is now read both ways, and each reading requires its endpoint half to match the stored endpoint keys: `search` becomes `_search` and holds, `knn` becomes `_knn` and matches nothing, so only the reading that holds returns rows. `knn search`, `search knn`, `_search knn` and `knn _search` now all return the search operation with its `knn` rows. Each reading carries its own inner-hits name, because Elasticsearch rejects two nested queries that share one, and the result processor merges the groups. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Highlight the field word of a query in either order on property rows A property row highlighted only the last query word, a leftover of the rule that read the last word as the field, so `knn search` marked nothing on the `knn` rows that the query now returns. The row now highlights every query word that can name a field, which excludes paths and HTTP method words, so `knn search` and `search knn` both mark `knn`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Report a clicked result's rank, not its keyboard row, in telemetry A property row's click reported the keyboard row index, which counts the property rows above it, so a page listed after an operation with three fields was reported at position 4. The position is now the result's rank among the results for the operation and for each of its properties, and the anchor keeps identifying the property row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Never let a query word match a path placeholder in the route line A query word was matched against the raw spec path, so `index` or `id` matched `{index}` and `{id}` and a query such as `delete index` replaced most descriptions with a route line even though it named no path. A placeholder now stands as `*` when a path is compared, as the indexed endpoint keys already do, so only a literal segment can match. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Treat an HTTP method word as an endpoint only before a path A method word was never allowed to be the field, so `options` found no property and `_bulk delete` looked for a field named `_bulk`, although both are real schema fields. A method word now marks the endpoint only when the next word starts with a slash, as in `GET /_search`, on both the query builder and the result row's highlighting. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Keep field matching out of the way of pages in the docs-wide search The nested field query also ran in the unfiltered docs search for any single word, matching field names by prefix, so `s` or `index` lifted hundreds of API operations above the pages about them and inflated the type counts. The docs-wide search now tries only words that look like identifiers, containing `_` or `.`, and matches a field by its exact name; the prefix clause stays in the API-filtered lookup where the bare-word endpoint boost already lives for the same reason. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Match the literal endpoint as well as its underscore alias The endpoint half of a combined query tried the underscore alias first and, since `_deployments` always builds a query, never tried the literal `deployments`. With the endpoint required in a two-word query, `deployments status` could not reach the fields of `/deployments`. The endpoint half now accepts the path as typed or its alias. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Keep only the inner hits of the reading a document matched Elasticsearch computes a nested query's inner hits for every returned document from that nested query alone, so a two-word query's rejected reading still attached its field rows: for `knn search` the reading that paired field `search` with endpoint `_knn` returned `search_*` rows on the search operation, which could take two of the three slots. Each reading is now a named query carrying its inner-hits name, and the processor keeps a group only when the hit matched that reading. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Index every listing the operation page keeps apart The exporter rendered every property description as an empty string, so two listings that differ only in their variant descriptions hashed alike and the second was folded into the first. The page renders the descriptions and keeps both, so its anchors had no index entries. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Try a docs-wide field word only when it looks like an identifier The guard looked at the whole query, so `elasticsearch index_name settings` passed it on the underscore and then tried the plain word `settings` as the field, lifting every operation with a `settings` field into the docs-wide results. The check now applies to the field word of each reading, which is what the docs describe. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Keep no field rows on a hit that matched no reading Elasticsearch leaves matched_queries out of a hit when no named query matched it, so a hit the lexical branch alone matched looked the same as a hit from a query that named nothing, and kept the inner hits of every reading. Every reading is now named, so the processor can require the name and drop the rows of a reading the hit did not match. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Key listing identity on the description markdown, not its HTML The page and the index build the same property tree with different markdown renderers, and listing identity hashed the rendered HTML, so the two could disagree on which listings to share: `*Code it*` and `_Code it_` are one listing on the page and two in the index, leaving index entries whose anchors the page never renders. Identity now keys on the markdown both builders have, and the index renders nothing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Decide the endpoint requirement from the query, not the surviving readings Whether a reading must match its endpoint was taken from how many readings were left, so once the docs-wide filter dropped the plain reading of `bulk track_total_hits`, the one that remained had its endpoint demoted to a lift and admitted every operation with the field. The parse now records that two plain words require their endpoints, and the filter keeps that. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Jan Calanog <reakaleek@users.noreply.github.com> Co-authored-by: GPT-6 <noreply@anthropic.com> Co-authored-by: Andrea De Pirro <andrea.depirro@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why
Type ❲/❳ to explore API. The bracket glyphs look odd, and the hint disappears as soon as the user types.What
Explore APIsand show a/key chip inside the field. The chip hides when the field has focus or text.Explore APIsplaceholder and/chip as the sidebar box.Notes
variant="hero"of<navigation-search>. The sidebar variant is unchanged.aria-keyshortcuts.🤖 Generated with Claude Code