Skip to content

Commit

Permalink
优化计数器
Browse files Browse the repository at this point in the history
  • Loading branch information
newpanjing committed Jun 13, 2022
1 parent 64c029b commit 06caafa
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions searcher/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,24 +323,12 @@ func (e *Engine) addPositiveIndex(index *model.IndexDoc, keys []string) {
//设置到id和key的映射中
positiveIndexStorage.Set(key, utils.Encoder(keys))
}
func (e *Engine) SearchAll(request *model.SearchRequest) *model.SearchResult {

//获取所有的数据库,然后便利
count := e.GetDocumentCount()
fmt.Println(count)
return nil
}

// MultiSearch 多线程搜索
func (e *Engine) MultiSearch(request *model.SearchRequest) *model.SearchResult {
//等待搜索初始化完成
e.Wait()

//如果搜索词为空,就返回全部数据,不处理排序
if request.Query == "" {
return e.SearchAll(request)
}

//分词搜索
words := e.Tokenizer.Cut(request.Query)

Expand Down

0 comments on commit 06caafa

Please sign in to comment.