MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / buildNoteSearchIndex

Function buildNoteSearchIndex

packages/app-core/src/lib/note-search.ts:24–39  ·  view source on GitHub ↗
(notes: NoteMeta[])

Source from the content-addressed store, hash-verified

22const LONG_QUERY_EXACT_FIRST_CHARS = 16
23
24export function buildNoteSearchIndex(notes: NoteMeta[]): NoteSearchEntry[] {
25 return notes.map((note) => {
26 const tagsLower = note.tags.map((tag) => tag.toLowerCase())
27 return {
28 note,
29 title: note.title,
30 titleLower: note.title.toLowerCase(),
31 path: note.path,
32 pathLower: note.path.toLowerCase(),
33 excerpt: note.excerpt,
34 excerptLower: note.excerpt.toLowerCase(),
35 tags: tagsLower.join(' '),
36 tagsLower
37 }
38 })
39}
40
41export function parseNoteSearchQuery(query: string): ParsedNoteSearchQuery {
42 const tags: string[] = []

Callers 4

NotePickerOverlayFunction · 0.90
SearchPaletteFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected