Documentation
¶
Index ¶
- func All() *all
- func And(clauses ...Query) *and
- func None() *none
- func Not(clause Query) *not
- func Or(clauses ...Query) *or
- type Block
- type BlugeIndex
- func (i *BlugeIndex) Close() error
- func (i *BlugeIndex) DeletePage(ctx context.Context, subPath string) error
- func (i *BlugeIndex) GetLastModified(ctx context.Context, subPath string) (time.Time, error)
- func (i *BlugeIndex) IndexPage(ctx context.Context, page *Page) error
- func (i *BlugeIndex) SearchBlocks(ctx context.Context, q Query, opts SearchOptions) (SearchResults[*Block], error)
- func (i *BlugeIndex) SearchPages(ctx context.Context, q Query, opts SearchOptions) (SearchResults[*Page], error)
- func (i *BlugeIndex) Sync() error
- type Index
- type Page
- type PageType
- type Query
- func ContentMatches(text string) Query
- func LinksToURL(url string) Query
- func PropertyEquals(property string, value string) Query
- func PropertyMatches(property string, text string) Query
- func PropertyReferences(property string, target string) Query
- func PropertyReferencesTag(property string, target string) Query
- func References(page string) Query
- func ReferencesTag(tag string) Query
- func TitleMatches(text string) Query
- type SearchOptions
- type SearchResults
- type SortField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlugeIndex ¶
type BlugeIndex struct {
// contains filtered or unexported fields
}
func NewBlugeIndex ¶
func NewBlugeIndex(graphConfig *utils.GraphConfig, indexDirectory string) (*BlugeIndex, error)
func (*BlugeIndex) Close ¶
func (i *BlugeIndex) Close() error
func (*BlugeIndex) DeletePage ¶
func (i *BlugeIndex) DeletePage(ctx context.Context, subPath string) error
func (*BlugeIndex) GetLastModified ¶
func (*BlugeIndex) IndexPage ¶
func (i *BlugeIndex) IndexPage(ctx context.Context, page *Page) error
func (*BlugeIndex) SearchBlocks ¶
func (i *BlugeIndex) SearchBlocks(ctx context.Context, q Query, opts SearchOptions) (SearchResults[*Block], error)
func (*BlugeIndex) SearchPages ¶
func (i *BlugeIndex) SearchPages(ctx context.Context, q Query, opts SearchOptions) (SearchResults[*Page], error)
func (*BlugeIndex) Sync ¶
func (i *BlugeIndex) Sync() error
type Index ¶
type Index interface {
// Close this index.
Close() error
// Sync makes sure the index has been synced and any changes are queryable.
// Syncing may involve writing to disk.
Sync() error
// DeletePage removes a page from the index.
DeletePage(ctx context.Context, subPath string) error
// IndexPage indexes a page in the search index.
IndexPage(ctx context.Context, doc *Page) error
// GetLastModified returns the last modified time for a page. Should return
// a zero time if the page does not exist in the index.
GetLastModified(ctx context.Context, subPath string) (time.Time, error)
// SearchPages searches for pages in the index.
SearchPages(ctx context.Context, query Query, opts SearchOptions) (SearchResults[*Page], error)
// SearchBlocks searches for blocks in the index.
SearchBlocks(ctx context.Context, query Query, opts SearchOptions) (SearchResults[*Block], error)
}
type Page ¶
type Page struct {
// SubPath is the sub path of the page in the graph.
SubPath string
// Type is the type of the page.
Type PageType
// LastModified is the last time the page was modified on disk.
LastModified time.Time
// Title is the title of the page. Only used for dedicated pages.
Title string
// Date is the date of the journal. Only used for journals.
Date time.Time
// Preview string of the page, only used when searching.
Preview string
// Blocks is the blocks of the page, only used while indexing.
Blocks content.BlockList
}
type Query ¶
type Query interface {
// contains filtered or unexported methods
}
func ContentMatches ¶
func LinksToURL ¶
func PropertyEquals ¶
func PropertyMatches ¶
func PropertyReferences ¶
func PropertyReferencesTag ¶
func References ¶
func ReferencesTag ¶
func TitleMatches ¶
type SearchOptions ¶
type SearchResults ¶
type SearchResults[V any] interface { // Size is the number of results available in this result set. Size() int // Count is the number of results that are available in total. For the // number of results available via Results, use Size. Count() int // Results is a slice of all the results in this result set. Results() []V }
Click to show internal directories.
Click to hide internal directories.