feat(search): scope searches to a drive via the driveId field - #3299
Draft
dschmidt wants to merge 2 commits into
Draft
feat(search): scope searches to a drive via the driveId field#3299dschmidt wants to merge 2 commits into
dschmidt wants to merge 2 commits into
Conversation
dschmidt
force-pushed
the
feat/search-scope
branch
from
August 12, 2026 23:51
1dfcf3f to
a4a4876
Compare
Not up to standards ⛔
|
dschmidt
force-pushed
the
feat/search-scope
branch
from
August 12, 2026 23:57
a4a4876 to
a952505
Compare
dschmidt
force-pushed
the
feat/search-scope
branch
from
August 13, 2026 00:11
a952505 to
97e42dd
Compare
scope: takes an opaque resource id, which is hostile to hand-written queries. Accept driveId:"<storage$space>" as a regular KQL field instead: it resolves to the indexed RootID, and a bare drive id is completed to the root resource id (a space root's opaque id is its space id). Full root ids pass through untouched. Combined with path: this gives a readable location scope without any token stripping: both are plain fields, so they compose with groups, OR and NOT like everything else.
When top-level AND conjuncts pin the query to a single root (driveId/RootID restrictions), only that space's index is asked; the restriction itself stays in the query, so this is purely an optimization. Conservative by design: any top-level OR, negated or group-nested restriction leaves the fan-out untouched, searching a space too many is wasted work while skipping one would be wrong. Mountpoints are kept for result path mapping. Costs one extra parse of the query in the service; parsing once and handing the AST to the engines (which currently re-parse per space) is a follow-up that changes the engine interface.
dschmidt
force-pushed
the
feat/search-scope
branch
from
August 13, 2026 00:13
97e42dd to
796fbf6
Compare
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.
scope:takes an opaque resource id, which is hostile to hand-written queries. AcceptdriveId:"<storage$space>"as a regular KQL field instead: it resolves to the indexedRootIDand a bare drive id is completed to the root resource id. Combined withpath:this gives a readable location scope with no token stripping, both compose with groups, OR and NOT like any other field.Second commit prunes the space fan-out when top-level AND conjuncts pin the query to a single root; conservative rules, the restriction stays in the query, mountpoints are kept for path mapping.
Follow-up (deliberately not here): parse the query once in the service and hand the AST to the engines, which currently re-parse per space; that changes the engine interface.
Stacked on #2659.