Documentation
¶
Index ¶
- func BuildLanguageDetector()
- func End()
- func Init() error
- func ShouldShowReindexButton() bool
- func StreamingReindexHTML(w http.ResponseWriter, r *http.Request)
- func UpdateLanguagesChange() error
- func UpdateReindex() error
- func UpdateSearchOn() error
- type BleveIndex
- func (b *BleveIndex) Close()
- func (b *BleveIndex) CountEvents(filter nostr.Filter) (uint32, error)
- func (b *BleveIndex) DeleteEvent(id nostr.ID) error
- func (b *BleveIndex) IndexEvent(event nostr.Event) error
- func (b *BleveIndex) Init() error
- func (b *BleveIndex) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq[nostr.Event]
- func (b *BleveIndex) SaveEvent(evt nostr.Event) error
- type Lexer
- type Parser
- type SearchStats
- type Token
- type TokenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildLanguageDetector ¶
func BuildLanguageDetector()
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
}
var ( Main *BleveIndex Languages = []lingua.Language{ lingua.Arabic, lingua.Chinese, lingua.Croatian, lingua.Danish, lingua.Dutch, lingua.English, lingua.Finnish, lingua.French, lingua.German, lingua.Hindi, lingua.Hungarian, lingua.Italian, lingua.Japanese, lingua.Korean, lingua.Persian, lingua.Polish, lingua.Portuguese, lingua.Romanian, lingua.Russian, lingua.Spanish, lingua.Swedish, lingua.Turkish, } )
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 ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
lexer tokenizes the input string
func (*Lexer) ReturnToken ¶
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
Click to show internal directories.
Click to hide internal directories.