Repository navigation
Index each API operation's words, group and id word count for search - #4698
Merged
Merged
Conversation
The API search is moving to a per-token model where a typed word may name an operation by its endpoint, by a word of its id or path, by its group, or by a field. Those words and the group existed only concatenated into `search_title`, so they could not be weighted apart from the title and the method. `api.words` and `api.group` give each its own field, and `api.id_words` is a rank feature that breaks ties toward the more specific operation (`esql-query` over `esql-async-query-stop`). The query that reads them follows in the next change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4698/ |
This was referenced Nov 4, 2026
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.
Every indexed API operation now carries its own
api.words,api.groupandapi.id_wordsfields. Nothing changes for readers yet; the API search query that reads them follows in the next pull request.Affects: Search, API reference
Prompt summary: The API search box ranks
search retrieverperfectly but returns bogus results forcluster flat_settingsand nothing useful fores|ql drop_null_columns, although both are real query parameters. Asked why, and then asked to design the fix properly instead of patching the rule, the work became a per-token query model delivered as a stack of three changes. This is the bottom layer, the index fields that model reads.Why
The API search reads an operation's name words only inside
search_title, where they sit next to the product label, the HTTP method and the group. A query cannot weight a word of the operation id (cluster,esql) apart from a word of its title or its group, and it has no way to preferesql-queryoveresql-async-query-stopwhen both carry the typed field. The new query model needs each of those signals as a field of its own.What
Words and group as fields of their own
ApiOperationMetadatagainsWords, the plain words of the operation id and its literal path segments thatApiSearchWords.Ofalready computes forsearch_title, andGroup, the title of the operation's group as the explorer shows it. Both are text fields with the synonym analyzers, andapi.wordsalso has acompletionsearch-as-you-type multi-field for prefix matching. #4666 kept the group out ofapi.*because its query never read it; the test that asserted the absence now asserts the field.A specificity prior
IdWordscounts the words of the operation id alone and is mapped as arank_featurewith negative score impact, likenavigation.depth. Fewer id words is a more specific operation, so a query can break ties toward it.The exporter fills them
OpenApiDocumentExportersets the three fields next to the existing operation metadata. The document hash already covers the wholeapirecord, so an incremental index run re-syncs every operation.Verify
Out of scope: the query that reads the new fields, and the removal of the two-reading parse it replaces. Both follow in this stack.
Risk: the
apimapping changes, so the first index run after deploy rolls the indices over to new dated indices, about six minutes on dev, as the last mapping change did.Stack: 1 of 3. #4699 (the per-word query) and #4700 (the removal of the legacy readings) sit on top of this branch.
🤖 Generated with Claude Code