ENG-2108 Add ranked search to QueryEngine with a vault-iteration fallback - #1284
Open
trangdoan982 wants to merge 1 commit into
Open
ENG-2108 Add ranked search to QueryEngine with a vault-iteration fallback#1284trangdoan982 wants to merge 1 commit into
trangdoan982 wants to merge 1 commit into
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
trangdoan982
force-pushed
the
eng-2108-add-ranked-search-to-queryengine-with-a-vault-iteration
branch
from
August 7, 2026 20:59
22188a8 to
44c784b
Compare
1 task
trangdoan982
force-pushed
the
eng-2108-add-ranked-search-to-queryengine-with-a-vault-iteration
branch
from
August 8, 2026 17:32
44c784b to
07bb663
Compare
trangdoan982
force-pushed
the
eng-2108-add-ranked-search-to-queryengine-with-a-vault-iteration
branch
from
August 9, 2026 03:55
07bb663 to
f89d51d
Compare
trangdoan982
force-pushed
the
eng-2108-add-ranked-search-to-queryengine-with-a-vault-iteration
branch
from
August 9, 2026 17:22
f89d51d to
79938ba
Compare
…back Add a Scorer seam over Obsidian's prepareFuzzySearch, plus the candidate fetch and ranking functions the advanced node search panel needs. Separate the candidate fetch from scoring so the vault scan runs once per search-surface open rather than once per keystroke, and route it through getFilesWithNodeTypeId, which already falls back to vault iteration when Datacore is unavailable. Score and render the same string (file.basename) so SearchResult.matches offsets stay aligned with what renderResults re-slices. Filter by node type before scoring, which leaves results identical but shrinks the number of scorer calls on the per-keystroke path. Rank on SearchResult.score alone; Array.prototype.sort is stable, so equal scores keep candidate order without an explicit tie-break. An empty query returns the full filtered set in title order rather than nothing, so a type filter alone still narrows to a visible list. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
trangdoan982
force-pushed
the
eng-2108-add-ranked-search-to-queryengine-with-a-vault-iteration
branch
from
August 9, 2026 17:28
79938ba to
9708e95
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 check
$scope-checkagainst ENG-2108 and the final diff.Done When: None.Mapping
One file, one concern. Three deviations from the ticket's literal wording, all narrowing rather than expanding:
createScorerwas dropped as a meaningless one-line wrapper overprepareFuzzySearch; theScorertype and thescorer?injection parameter were dropped as unused indirection, soprepareFuzzySearchis called directly; andfilterCandidatesByNodeTypeIdsis exported instead, because the ticket requires callers to memoize the filtered array — which is only possible if the filter is callable on its own. No new dependencies, no migrations, no unrelated refactors.What this does
Adds the search seam for the Obsidian advanced node search panel (F1 of Advanced Node Search (Obsidian)). No UI — the panel is #1285, stacked on this.
QueryEngine.ts:DiscourseNodeCandidate,RankedDiscourseNodegetDiscourseNodeCandidates(){ file, title, nodeTypeId }filterCandidatesByNodeTypeIds(...)rankDiscourseNodesByTitle({...})Three decisions worth reviewing
Datacore first, vault iteration as fallback — via delegation, so it is not visible in this diff. The call chain:
Reusing that method rather than writing a second fallback here is why NF3 holds for free.
Verification
check-typesclean,eslint0 problems on the changed file.The reviewable demo is #1285, stacked on this branch: https://www.loom.com/share/877db7d2de834548a81bca1750bbbecb
🤖 Generated with Claude Code