Documentation ¶
Index ¶
- type Engine
- func (e *Engine) AllKeys(docs *model.NegSearch) ([]KeyItem, error)
- func (e *Engine) BatchNegativeKeys(docs *[]model.NegativeDoc) ([]string, error)
- func (e *Engine) HasNegative(text string) ([]KeyItem, bool, error)
- func (e *Engine) NegativeKeys(doc *model.NegativeDoc) (string, error)
- func (e *Engine) QueryNegative(s *model.NegSearch) (*model.NegResult, error)
- func (e *Engine) RemoveNegative(id string) error
- type KeyItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { NegativeStorage *storage.LeveldbStorage //存储负向文档的storage Tokenizer *words.Tokenizer NegativeCount int //负向文档数量 }
func (*Engine) AllKeys ¶
AllKeys 函数从负向搜索的文档中获取所有关键词并返回 Engine是调用该方法的类型 docs是指向model.NegSearch的指针,表示负向搜索的文档 返回值为一个KeyItem类型的切片和error类型
func (*Engine) BatchNegativeKeys ¶
func (e *Engine) BatchNegativeKeys(docs *[]model.NegativeDoc) ([]string, error)
BatchNegativeKeys 函数批量处理NegativeDoc类型指针切片,将其存储在NegativeStorage中,并返回存储成功的id列表和错误信息
func (*Engine) HasNegative ¶
检测是否在关键字中
func (*Engine) NegativeKeys ¶
func (e *Engine) NegativeKeys(doc *model.NegativeDoc) (string, error)
func (*Engine) QueryNegative ¶
func (*Engine) RemoveNegative ¶
Click to show internal directories.
Click to hide internal directories.