search

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTitle

func ExtractTitle(content string) string

func GetIndexPath

func GetIndexPath(baseDir string) string

Types

type Index

type Index struct {
	// contains filtered or unexported fields
}

func Open

func Open(dbPath string) (*Index, error)

func (*Index) Close

func (idx *Index) Close() error

func (*Index) DeleteNote

func (idx *Index) DeleteNote(ctx context.Context, path string) error

func (*Index) FullRebuild

func (idx *Index) FullRebuild(ctx context.Context, notesDir string, opts *SyncOptions) (*SyncResult, error)

func (*Index) GetIndexedPaths

func (idx *Index) GetIndexedPaths(ctx context.Context) (map[string]int64, error)

func (*Index) GetStats

func (idx *Index) GetStats(ctx context.Context) (map[string]interface{}, error)

func (*Index) IndexNote

func (idx *Index) IndexNote(ctx context.Context, path, title, content string, modTime time.Time) error

func (*Index) Search

func (idx *Index) Search(ctx context.Context, query string, limit int) ([]SearchResult, error)

func (*Index) SearchByTag

func (idx *Index) SearchByTag(ctx context.Context, tag string, limit int) ([]SearchResult, error)

func (*Index) Sync

func (idx *Index) Sync(ctx context.Context, notesDir string, opts *SyncOptions) (*SyncResult, error)

type SearchResult

type SearchResult struct {
	Path    string
	Title   string
	Snippet string
	Rank    float64
}

type SyncOptions

type SyncOptions struct {
	ProgressCallback func(indexed, total int)
	DeleteMissing    bool
}

type SyncResult

type SyncResult struct {
	Indexed  int
	Deleted  int
	Errors   int
	Skipped  int
	Duration time.Duration
}

Jump to

Keyboard shortcuts

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