Repository navigation
Remove the two-reading API parse the per-word lookup replaced - #4700
Merged
Merged
Conversation
This was referenced Nov 4, 2026
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4700/ |
reakaleek
force-pushed
the
api-search/drop-readings
branch
from
November 4, 2026 22:34
4c71216 to
90382af
Compare
The API lookup requires two words and then three quarters of them on its own, so `ApplyApiRanking` and `BuildLoosePartialMatchQuery` have no caller left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the API lookup lists a typed path's children now, so the children ordering cases run with `ApiLookup` set and the word resolved to the field role. Their assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reading tests in `ApiPropertySearchTests` held the only checks of these shapes. Moving them onto `ApiLookupQueryBuilder.Build` lets the API branches of the reading code go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`ApiLookupQueryBuilder` serves the `api` filter, so the readings no longer branch on it. `IsApiLookup`, `Lookup` and `SearchQueryBuilder.ExpandsChildren` go, a reading always uses the docs-wide lookup, and only the API lookup sets `ListChildren`. Docs-wide queries are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docs-wide search still builds a marked-endpoint lift and two readings with distinct inner-hit names. Dropping the api-filtered tests removed the only coverage of both. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`GET /_search knn` is two tokens now that the method joins its path, so the `knn` word sits at index 1, not 2. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
reakaleek
force-pushed
the
api-search/drop-readings
branch
from
November 4, 2026 22:35
90382af to
cd1d49e
Compare
This branch was successfully deployed
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.
SearchQueryBuilderloses the API-only branches that the per-word lookup in the layer below made dead: the loose partial match,ApplyApiRanking, theapitype filter in the reading parse, the prefix and children options of a reading, and the tests that covered them. Nothing changes for readers; the docs-wide search keeps its identifier field reading exactly as before.Affects: Search
Prompt summary: The API search box ranks
search retrieverperfectly but returns bogus results forcluster flat_settingsand nothing useful fores|ql drop_null_columns. 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 top layer, the deletion of what the new query replaced.Why
After the layer below,
type=apirequests never reach the reading parse, so its API-only paths have no caller. Leaving them in would keep two models of the same query alive and invite the next change to patch the wrong one.What
One lookup for the docs-wide readings
A docs-wide reading always used no prefix and no children; it now says so through one fixed
DocsWideLookup, and theapibranches that chose otherwise are gone. The loose 75 percent clause and the bare-word endpoint lift for API queries are deleted with the method that applied them, since the per-word lookup has both natively.Tests follow the behaviour
The children-row result tests move to the API lookup's own result path, which is the only place children are listed now, with their assertions unchanged. Six cases that only the old reading tests covered (exact and prefix name matches with bounded scores, the qualified path, the parent key of the children option, what a trailing dot keeps) are added against the new builder before the old ones go. The remaining reading tests run docs-wide only.
Verify
Out of scope:
BuildApiPropertyQuerykeeps itstypeFilterparameter for its test callers; a later cleanup can drop it.Stack: 3 of 3, on top of #4699, which sits on #4698.
🤖 Generated with Claude Code