#118 - Improved caching
That will teach me to read documentation (it won't).
This commit is contained in:
@@ -89,12 +89,15 @@ export class SearchEngine {
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called when the background indexing is done,
|
||||
* to load the freshest data into the main instance
|
||||
* Loads the freshest indexed data into the main instance.
|
||||
*/
|
||||
public static swapEngines(): void {
|
||||
;[this.engine, this.tmpEngine] = [this.tmpEngine, this.engine]
|
||||
this.isIndexing.set(false)
|
||||
public static loadTmpDataIntoMain(): void {
|
||||
const tmpData = this.tmpEngine.minisearch.toJSON()
|
||||
this.engine.minisearch = MiniSearch.loadJS(tmpData, minisearchOptions);
|
||||
}
|
||||
|
||||
public static clearTmp():void {
|
||||
this.tmpEngine.minisearch = new MiniSearch(minisearchOptions)
|
||||
}
|
||||
|
||||
private minisearch: MiniSearch
|
||||
|
||||
Reference in New Issue
Block a user