search

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package search is the note-search scoring the app's search palette uses: exact and prefix matches first, then word starts, then substrings, then a fuzzy subsequence for short queries; `#tag` tokens narrow the set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fold

func Fold(s string) string

Fold lower-cases a string and strips diacritics, so "resume" finds "Résumé". Nonspacing marks (unicode category Mn) are what accents decompose into under NFD.

func Fuzzy

func Fuzzy(query, label string) float64

Fuzzy is a general-purpose scorer for palettes over arbitrary labels: exact, prefix, word-start, substring, then subsequence. 0 means no match.

func MatchPositions

func MatchPositions(query, label string) []int

MatchPositions reports which runes of label a query matches as an in-order subsequence, case- and accent-insensitively. It returns nil when the query does not match. Used to underline matches in pickers.

func Notes

func Notes(index []Entry, query string, limit int, quickFirst bool) []vault.NoteMeta

Notes runs a query over the index. With no free text the live notes come back in their given order, tag filters applied; quick notes first and most recent first when quickFirst is set.

Types

type Entry

type Entry struct {
	Note vault.NoteMeta
	// contains filtered or unexported fields
}

Entry is a note prepared for scoring.

func Index

func Index(notes []vault.NoteMeta) []Entry

Index prepares notes for repeated searches.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL