Minisearch 6.0 mostly ok

This commit is contained in:
Simon Cambier
2022-11-25 22:40:59 +01:00
parent dcef2d3719
commit e3ac5a4bac
16 changed files with 196 additions and 1058 deletions

View File

@@ -1,4 +1,5 @@
import { EventBus } from './tools/event-bus'
import { writable } from 'svelte/store'
export const regexLineSplit = /\r?\n|\r|((\.|\?|!)( |\r?\n|\r))/g
export const regexYaml = /^---\s*\n(.*?)\n?^---\s?/ms
@@ -16,7 +17,7 @@ export const EventNames = {
ToggleExcerpts: 'toggle-excerpts',
} as const
export const enum IndexingStep {
export const enum IndexingStepType {
Done,
LoadingCache,
ReadingNotes,
@@ -50,6 +51,8 @@ export const isSearchMatch = (o: { offset?: number }): o is SearchMatch => {
return o.offset !== undefined
}
export const indexingStep = writable(IndexingStepType.LoadingCache)
export type ResultNote = {
score: number
path: string