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:
@@ -484,6 +484,7 @@ export class SearchEngine {
|
|||||||
let bestMatch: SearchMatch | undefined
|
let bestMatch: SearchMatch | undefined
|
||||||
if (
|
if (
|
||||||
matches.length > 0 &&
|
matches.length > 0 &&
|
||||||
|
(query.query.text.length > 1 || query.getExactTerms().length > 0) &&
|
||||||
query.getBestStringForExcerpt() &&
|
query.getBestStringForExcerpt() &&
|
||||||
matches[0].match.toLowerCase() === query.getBestStringForExcerpt()
|
matches[0].match.toLowerCase() === query.getBestStringForExcerpt()
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user