search

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Unlicense Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLanguageDetector

func BuildLanguageDetector()

func End

func End()

func Init

func Init() error

func ShouldShowReindexButton

func ShouldShowReindexButton() bool

ShouldShowReindexButton returns true if reindex button should be shown (if anything has changed we should show it)

func StreamingReindexHTML

func StreamingReindexHTML(w http.ResponseWriter, r *http.Request)

func UpdateLanguagesChange

func UpdateLanguagesChange() error

UpdateLanguagesChange updates the timestamp when languages are changed

func UpdateReindex

func UpdateReindex() error

UpdateReindex updates the timestamp when reindex is called

func UpdateSearchOn

func UpdateSearchOn() error

UpdateSearchOn updates the timestamp when search is turned on

Types

type BleveIndex

type BleveIndex struct {
	sync.Mutex
	// Path is where the index will be saved
	Path string

	// RawEventStore is where we'll fetch the raw events from
	// bleve will only store ids, so the actual events must be somewhere else
	RawEventStore eventstore.Store
	// contains filtered or unexported fields
}

func (*BleveIndex) Close

func (b *BleveIndex) Close()

func (*BleveIndex) CountEvents

func (b *BleveIndex) CountEvents(filter nostr.Filter) (uint32, error)

func (*BleveIndex) DeleteEvent

func (b *BleveIndex) DeleteEvent(id nostr.ID) error

func (*BleveIndex) IndexEvent

func (b *BleveIndex) IndexEvent(event nostr.Event) error

func (*BleveIndex) Init

func (b *BleveIndex) Init() error

func (*BleveIndex) QueryEvents

func (b *BleveIndex) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq[nostr.Event]

func (*BleveIndex) SaveEvent

func (b *BleveIndex) SaveEvent(evt nostr.Event) error

type Lexer

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

lexer tokenizes the input string

func NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() (tok Token)

func (*Lexer) PeekToken

func (l *Lexer) PeekToken() Token

func (*Lexer) ReturnToken

func (l *Lexer) ReturnToken(tok Token)

type Parser

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

type SearchStats

type SearchStats struct {
	LastSearchOn        time.Time `json:"last_search_on"`
	LastReindex         time.Time `json:"last_reindex"`
	LastLanguagesChange time.Time `json:"last_languages_change"`
	DocumentCount       int64     `json:"-"`
}

SearchStats holds timestamps for various search-related operations

func GetStats

func GetStats() (*SearchStats, error)

GetStats returns the current search statistics, including the current document count

type Token

type Token struct {
	Type  TokenType
	Value string
}

type TokenType

type TokenType int

token types

const (
	TokenWord TokenType = iota
	TokenOR
	TokenAND
	TokenNOT
	TokenLParen
	TokenRParen
	TokenQuote
	TokenEOF
)

Jump to

Keyboard shortcuts

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