fix: Correct single-word query ranking to prioritize headings

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-05 13:21:14 -07:00
parent 2b00a7af2d
commit c4c4e782fb

View File

@@ -484,6 +484,7 @@ export class SearchEngine {
let bestMatch: SearchMatch | undefined
if (
matches.length > 0 &&
(query.query.text.length > 1 || query.getExactTerms().length > 0) &&
query.getBestStringForExcerpt() &&
matches[0].match.toLowerCase() === query.getBestStringForExcerpt()
) {