gofound

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client 应该对外部屏蔽细节 尽量少的提供接口,但是又要保证功能性

func Default

func Default() *Client

Default 使用默认参数创建服务

func NewClient

func NewClient(config *global.Config) *Client

NewClient 通过参数进行配置,必须指定全部参数

func (*Client) AddIndex

func (c *Client) AddIndex(dbName string, request *model.IndexDoc) error

AddIndex 添加索引

func (*Client) BatchAddIndex

func (c *Client) BatchAddIndex(dbName string, documents []*model.IndexDoc) error

BatchAddIndex 批次添加索引

func (*Client) BatchWordCut

func (c *Client) BatchWordCut(keywords []string) *[][]string

BatchWordCut 批量分词

func (*Client) Create

func (c *Client) Create(dbName string) (*searcher.Engine, error)

Create 创建数据库

func (*Client) Drop

func (c *Client) Drop(dbName string) error

Drop 删除数据库

func (*Client) GC

func (*Client) GC()

func (*Client) Query

func (c *Client) Query(req *model.SearchRequest) (*model.SearchResult, error)

Query 查询

func (*Client) RemoveIndex

func (c *Client) RemoveIndex(dbName string, data *model.RemoveIndexModel) error

RemoveIndex 删除索引

func (*Client) SetAddr

func (c *Client) SetAddr(addr string) *Client

SetAddr 设置Web服务地址

func (*Client) SetData

func (c *Client) SetData(dir string) *Client

SetData 设置数据存放地址

func (*Client) Show

func (c *Client) Show() (map[string]*searcher.Engine, error)

Show 查看数据库

func (*Client) Status

func (c *Client) Status() (map[string]interface{}, error)

func (*Client) WordCut

func (c *Client) WordCut(keyword string) []string

WordCut 分词

Jump to

Keyboard shortcuts

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