engine

package
v0.0.0-...-f8ab5ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KunlunEngine

type KunlunEngine struct {
	// contains filtered or unexported fields
}

func NewKunlunEngine

func NewKunlunEngine(options *types.EngineOptions) (*KunlunEngine, error)

func (*KunlunEngine) Close

func (engine *KunlunEngine) Close()

关闭引擎释放资源

func (*KunlunEngine) Finish

func (engine *KunlunEngine) Finish()

搜索前必须先调用这个函数

func (*KunlunEngine) GetContent

func (engine *KunlunEngine) GetContent(docID uint64) []byte

得到一个文档(docID 标识)的文本内容

func (*KunlunEngine) GetIndexerStats

func (engine *KunlunEngine) GetIndexerStats() types.IndexerStats

得到引擎中索引器的统计指标

func (*KunlunEngine) GetWalkerStats

func (engine *KunlunEngine) GetWalkerStats() types.IndexWalkerStats

得到引擎中遍历器的统计指标

func (*KunlunEngine) IndexDir

func (engine *KunlunEngine) IndexDir(dir string) error

将 dir 指定的目录里的文件加入引擎索引 在开始搜索前务必调用 Finish 函数

func (*KunlunEngine) IndexGitRemote

func (engine *KunlunEngine) IndexGitRemote(gitURL string) error

将 git 远程仓库里的文件加入引擎索引 在开始搜索前务必调用 Finish 函数

func (*KunlunEngine) IsFinished

func (engine *KunlunEngine) IsFinished() bool

func (*KunlunEngine) PrettyPrintSearchResponse

func (engine *KunlunEngine) PrettyPrintSearchResponse(
	searchResponse *types.SearchResponse,
	colorPrint bool,
	printContent bool)

在终端彩色打印搜索返回结果

func (*KunlunEngine) PullRepos

func (engine *KunlunEngine) PullRepos(dir string) error

将 dir 下各级目录的 git 仓库 pull 更新

func (*KunlunEngine) Search

func (engine *KunlunEngine) Search(request types.SearchRequest) (*types.SearchResponse, error)

完成一次搜索

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL