noteindex

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 7 Imported by: 1 module, 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 noteindex keeps on each note what finds it without opening it (#145): the blinds of the grams of its title and content for searchnotes, the blinds of the titles its [[links]] wait for for linknotes, whether it has a link or a file and the blinds of its headings for listbrokenlinks, the blinds of the grams of its headings (#169). A trigger of createschema empties them when the content changes, whoever writes it; Fill makes them again before they are read.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill(ctx context.Context, db bun.IDB) error

Fill indexes the notes of the account of ctx, trashed too, whose content changed since their last Fill (grams NULL). A note written again meanwhile keeps NULL: the content compared is the one indexed.

func FillAll

func FillAll(ctx context.Context, db bun.IDB) error

FillAll runs Fill for every account with notes left to index: tide-server serve runs it at start and in its loop, so a base just upgraded is indexed before its first search, and the notes of an idle account do not slow the Fill of the others.

func Grams

func Grams(text string) []string

Grams gives the pieces of 2 and 3 letters of text lowered: a text holding another holds all its grams.

func HeadingName

func HeadingName(heading string) string

HeadingName gives heading as a [[Note#Heading]] names it: no parentheses, trimmed. Blind ignores the case.

func Headings

func Headings(userID, content string) ([]int16, []string, error)

Headings gives the blinds of the grams of the headings of content, and the blind of each heading's HeadingName.

func Linked

func Linked(content string) bool

Linked tells whether content has what listbrokenlinks checks: a [[link]], a link to a note, a [label](path.md) link, the address of a file.

func Query

func Query(userID, text string) ([]int16, error)

Query gives the blinds a note holding text has, whatever its case: its trigrams, its bigram when it has 2 letters. nil for a single letter: every note is a candidate.

func Waiting

func Waiting(userID, content string) ([]string, error)

Waiting gives the blinds of the titles the [[links]] of content wait for: the target before its #heading, and the last name of a [[/Folder/Title]]. The titles of the notes it could resolve against are blinded the same way.

Types

This section is empty.

Jump to

Keyboard shortcuts

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