Fix ranking search results on Obsidian

It's reversed since score of entries is now a distance metric on
Khoj server. So lesser distance is better. Previously higher score was
better
This commit is contained in:
Debanjum Singh Solanky 2023-11-21 01:21:59 -08:00
parent 6d8e889917
commit c89bd49973

View file

@ -106,7 +106,7 @@ export class KhojSearchModal extends SuggestModal<SearchResult> {
// Combine markdown and PDF results and sort them by score
let results = mdData.concat(pdfData)
.sort((a: any, b: any) => b.score - a.score)
.sort((a: any, b: any) => a.score - b.score)
.map((result: any) => { return { entry: result.entry, file: result.file } as SearchResult; })
this.query = query;