Documentation ¶
Overview ¶
Package search contains types for searching for terms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Searcher ¶
type Searcher interface { Search(input string, limit int, ignore []string) (terms []*Term, err error) SearchCat(input string, cat, limit int, ignore []string) (terms []*Term, err error) // Return terms starting with the input Autocomplete(input string) (terms []string, err error) // Synchronize all terms with the search store SyncTerms(terms []*Term) (err error) // Synchronize a single term after updates SyncTerm(term *Term) (err error) // Delete a term from the search store SyncDelete(id int) (err error) }
Searcher is an interface for searching the term database.
type Term ¶
type Term struct { ID int `json:"id"` Category int `json:"category_id"` CategoryName string `json:"category"` Name string `json:"name"` Aliases []string `json:"aliases"` Description string `json:"description"` Note string `json:"note,omitempty"` Source string `json:"source"` Created time.Time `json:"created"` LastModified time.Time `json:"last_modified"` Tags []string `json:"-"` DisplayTags []string `json:"tags,omitempty"` ContentWarnings string `json:"content_warnings,omitempty"` ImageURL string `json:"image_url,omitempty"` Flags TermFlag `json:"flags"` // Rank is only populated with db.Search() Rank float64 `json:"rank"` // Headline is only populated with db.Search() Headline string `json:"headline,omitempty"` }
Term holds info on a single term
func (*Term) RandomHidden ¶
RandomHidden returns true if the term is hidden from the random command
func (*Term) SearchHidden ¶
SearchHidden returns true if the term is hidden from search results
Directories ¶
Path | Synopsis |
---|---|
Package pg implements the search.Searcher interface with the existing PostgreSQL database.
|
Package pg implements the search.Searcher interface with the existing PostgreSQL database. |
Package typesense implements search methods with a Typesense search server.
|
Package typesense implements search methods with a Typesense search server. |
Click to show internal directories.
Click to hide internal directories.