fix(file-search): rank exact-term edit target case-insensitively - #218
Open
thejesh23 wants to merge 1 commit into
Open
fix(file-search): rank exact-term edit target case-insensitively#218thejesh23 wants to merge 1 commit into
thejesh23 wants to merge 1 commit into
Conversation
…term match Terms are matched case-insensitively, but the confidence re-check used a case-sensitive line.includes(matchedTerm). On any casing mismatch the real edit target stayed 'medium' while an unrelated line containing return/export/function was promoted to 'high' and sorted above it. Lowercase both sides so an exact term hit is correctly ranked 'high'. Fixes firecrawl#217
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.
What
Fixes edit-target ranking in
performSearch: an exact search-term hit was sometimes left atmediumconfidence (and outranked by an unrelated line) because the confidence check re-tested the term case-sensitively, while the term itself is matched case-insensitively.Fixes #217
Root cause
lib/file-search-executor.tsmatches terms case-insensitively:but the confidence check re-tested case-sensitively:
On a casing mismatch the exact-match branch is skipped, so the real target stays
medium, while an unrelated line containingreturn/export/functionis promoted tohighand sorts above it — pointingselectTargetFileat the wrong line.Fix
Verification
searchTerms: ["Sign Up"]against:<button>sign up</button>mediumhigh// return to sign up pagehigh(viareturn)highThe real target is now correctly ranked
highinstead of being downgraded below the comment.