#92 - Simpler cache implementation

This commit is contained in:
Simon Cambier
2022-10-26 22:21:11 +02:00
parent 33e7f8fe25
commit cb8de1ad8d
9 changed files with 379 additions and 289 deletions

View File

@@ -1,6 +1,6 @@
import type { ResultNote, SearchMatch } from '../globals'
import { Query } from '../search/query'
import * as Search from '../search/search'
import { SearchEngine } from '../search/search-engine'
type ResultNoteApi = {
score: number
@@ -30,7 +30,7 @@ function mapResults(results: ResultNote[]): ResultNoteApi[] {
async function search(q: string): Promise<ResultNoteApi[]> {
const query = new Query(q)
const raw = await Search.getSuggestions(query)
const raw = await SearchEngine.getEngine().getSuggestions(query)
return mapResults(raw)
}