search

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

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

Index wraps a Bleve search index

func NewIndex

func NewIndex(indexPath string, rebuild bool) (*Index, error)

NewIndex creates or opens a Bleve search index

func (*Index) Close

func (idx *Index) Close() error

Close closes the index

func (*Index) Count

func (idx *Index) Count() (uint64, error)

Count returns the number of documents in the index

func (*Index) Delete

func (idx *Index) Delete(slug string) error

Delete removes a post from the index

func (*Index) IndexPost

func (idx *Index) IndexPost(post *models.Post) error

IndexPost indexes a single post

func (*Index) IndexPosts

func (idx *Index) IndexPosts(posts []*models.Post) error

IndexPosts indexes multiple posts

func (*Index) Search

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

Search performs a search query

type SearchResult

type SearchResult struct {
	Slug        string
	Score       float64
	Title       string
	Description string
}

SearchResult represents a search result

Jump to

Keyboard shortcuts

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