Documentation ¶
Index ¶
- type Container
- func (c *Container) DropDataBase(name string) error
- func (c *Container) GetDataBase(name string) *Engine
- func (c *Container) GetDataBaseNumber() int
- func (c *Container) GetDataBases() map[string]*Engine
- func (c *Container) GetDocumentCount() int64
- func (c *Container) GetIndexCount() int64
- func (c *Container) Init() error
- func (c *Container) NewEngine(name string) *Engine
- type Engine
- func (e *Engine) AddDocument(index *model.IndexDoc)
- func (e *Engine) Close()
- func (e *Engine) DocumentWorkerExec(worker chan *model.IndexDoc)
- func (e *Engine) Drop() error
- func (e *Engine) GetDocById(id uint32) []byte
- func (e *Engine) GetDocumentCount() int64
- func (e *Engine) GetIndexCount() int64
- func (e *Engine) GetOptions() *Option
- func (e *Engine) GetQueue() int
- func (e *Engine) IndexDocument(doc *model.IndexDoc) error
- func (e *Engine) Init()
- func (e *Engine) InitOption(option *Option)
- func (e *Engine) MultiSearch(request *model.SearchRequest) (*model.SearchResult, error)
- func (e *Engine) RemoveIndex(id uint32) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { Dir string //文件夹 Debug bool //调试 Tokenizer *words.Tokenizer //分词器 Shard int //分片 Timeout int64 //超时关闭数据库 BufferNum int //分片缓冲数 // contains filtered or unexported fields }
func (*Container) DropDataBase ¶
DropDataBase 删除数据库
func (*Container) GetDataBase ¶
GetDataBase 获取或创建引擎
func (*Container) GetDataBaseNumber ¶
func (*Container) GetDataBases ¶
GetDataBases 获取数据库列表
func (*Container) GetDocumentCount ¶
func (*Container) GetIndexCount ¶
type Engine ¶
type Engine struct { IndexPath string //索引文件存储目录 Option *Option //配置 sync.Mutex //锁 sync.WaitGroup //等待 IsDebug bool //是否调试模式 Tokenizer *words.Tokenizer //分词器 DatabaseName string //数据库名 Shard int //分片数 Timeout int64 //超时时间,单位秒 BufferNum int //分片缓冲数 // contains filtered or unexported fields }
func (*Engine) DocumentWorkerExec ¶
DocumentWorkerExec 添加文档队列
func (*Engine) GetOptions ¶
func (*Engine) InitOption ¶
func (*Engine) MultiSearch ¶
func (e *Engine) MultiSearch(request *model.SearchRequest) (*model.SearchResult, error)
MultiSearch 多线程搜索
Click to show internal directories.
Click to hide internal directories.