Documentation
¶
Overview ¶
Package search provides searching for notes using bleve library.
Index ¶
- func BuildIndex(notesPath string) (bleve.Index, error)
- func DeleteDocument(idx bleve.Index, path string) error
- func IndexDocument(idx bleve.Index, doc IndexedDocument) error
- func ReindexAll(idx bleve.Index, notesPath string) error
- func Search(idx bleve.Index, queryStr, tagInput string, start, end time.Time, ...) (*bleve.SearchResult, error)
- type IndexedDocument
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildIndex ¶
BuildIndex initializes an in-memory Bleve index and populates it with documents from the specified notesPath.
func DeleteDocument ¶
DeleteDocument removes a document from the search index by its path.
func IndexDocument ¶
func IndexDocument(idx bleve.Index, doc IndexedDocument) error
IndexDocument adds or updates a document in the search index.
func ReindexAll ¶
ReindexAll reads the notes directory, parses markdown files, and adds them to the provided Bleve search index.
Types ¶
type IndexedDocument ¶
type IndexedDocument struct {
Title string `json:"title"`
Content string `json:"content"`
Tags []string `json:"tags"`
Path string `json:"path"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
}
IndexedDocument represents a note's search-ready data structure.
func DocToIndexed ¶
func DocToIndexed(d frontmatter.Document) IndexedDocument
DocToIndexed converts a parsed markdown document with frontmatter into an IndexedDocument suitable for the search engine.
Click to show internal directories.
Click to hide internal directories.