Documentation
¶
Index ¶
- type KunlunEngine
- func (engine *KunlunEngine) Close()
- func (engine *KunlunEngine) Finish()
- func (engine *KunlunEngine) GetContent(docID uint64) []byte
- func (engine *KunlunEngine) GetIndexerStats() types.IndexerStats
- func (engine *KunlunEngine) GetWalkerStats() types.IndexWalkerStats
- func (engine *KunlunEngine) IndexDir(dir string) error
- func (engine *KunlunEngine) IndexGitRemote(gitURL string) error
- func (engine *KunlunEngine) IsFinished() bool
- func (engine *KunlunEngine) PrettyPrintSearchResponse(searchResponse *types.SearchResponse, colorPrint bool, printContent bool)
- func (engine *KunlunEngine) PullRepos(dir string) error
- func (engine *KunlunEngine) Search(request types.SearchRequest) (*types.SearchResponse, error)
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) 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)
完成一次搜索
Click to show internal directories.
Click to hide internal directories.