Documentation
¶
Index ¶
- Variables
- func Register(name string, engine Searcher)
- func Unregister(name string)
- type Config
- type IndexConfig
- type NopSearch
- func (n *NopSearch) Add(index string, primaryKey *string, docs ...interface{}) error
- func (m *NopSearch) Delete(index string, ids ...string) error
- func (n *NopSearch) Flush() error
- func (m *NopSearch) InitIndex(cfg *IndexConfig) error
- func (n *NopSearch) Search(index string, keywords string, options *SearchRequest) (int64, []echo.H, error)
- func (m *NopSearch) Update(index string, primaryKey *string, docs ...interface{}) error
- type SearchRequest
- type Searcher
Constants ¶
This section is empty.
Variables ¶
var DefaultSearch = &NopSearch{}
DefaultSearch is the default search engine implementation.
Functions ¶
func Unregister ¶
func Unregister(name string)
Types ¶
type IndexConfig ¶
type NopSearch ¶
type NopSearch struct{}
NopSearch is a no-op implementation of the Search interface.
func (*NopSearch) Add ¶
Add implements the search engine interface by doing nothing (no-op pattern) index: the name of the index to add documents to (ignored) primaryKey: the primary key identifier (ignored) docs: documents to add (ignored) Returns nil as this is a no-op implementation
func (*NopSearch) Delete ¶
Delete is a no-op implementation that does nothing and always returns nil. It satisfies the Search interface requirement for deleting documents from an index.
func (*NopSearch) InitIndex ¶
func (m *NopSearch) InitIndex(cfg *IndexConfig) error
InitIndex initializes the search index with the given configuration. This is a no-op implementation that always returns nil.
func (*NopSearch) Search ¶
func (n *NopSearch) Search(index string, keywords string, options *SearchRequest) (int64, []echo.H, error)
Search implements a no-operation search that returns empty results. It returns zero count, nil results, and nil error for any input.
type SearchRequest ¶
type Searcher ¶
type Searcher interface {
Add(index string, primaryKey *string, docs ...interface{}) error
Update(index string, primaryKey *string, docs ...interface{}) error
Delete(index string, ids ...string) error
Flush() error
InitIndex(cfg *IndexConfig) error
Search(index string, keywords string, options *SearchRequest) (int64, []echo.H, error)
}