service

package
v0.0.0-...-98a29f8 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callback

func Callback() map[string]interface{}

Types

type Base

type Base struct {
	Container *searcher.Container
	Callback  func() map[string]interface{}
}

Base 基础管理

func NewBase

func NewBase() *Base

func (*Base) GC

func (b *Base) GC()

GC 释放GC

func (*Base) Query

func (b *Base) Query(request *model.SearchRequest) (any, error)

Query 查询

func (*Base) Restart

func (b *Base) Restart()

Restart 重启服务

func (*Base) Status

func (b *Base) Status() map[string]interface{}

Status 获取服务器状态

type Database

type Database struct {
	Container *searcher.Container
}

func NewDatabase

func NewDatabase() *Database

func (*Database) Create

func (d *Database) Create(dbName string) *searcher.Engine

Create 创建数据库

func (*Database) Drop

func (d *Database) Drop(dbName string) error

Drop 删除数据库

func (*Database) Show

func (d *Database) Show() map[string]*searcher.Engine

Show 查看数据库

type Index

type Index struct {
	Container *searcher.Container
}

func NewIndex

func NewIndex() *Index

func (*Index) AddIndex

func (i *Index) AddIndex(dbName string, request *model.IndexDoc) error

AddIndex 添加索引

func (*Index) BatchAddIndex

func (i *Index) BatchAddIndex(dbName string, documents []*model.IndexDoc) error

BatchAddIndex 批次添加索引

func (*Index) IndexTaskCount

func (i *Index) IndexTaskCount(dbName string) int64

func (*Index) RemoveIndex

func (i *Index) RemoveIndex(dbName string, data *model.RemoveIndexModel) error

RemoveIndex 删除索引

type Negative

type Negative struct {
	Container *searcher.Container
}

func NewNegative

func NewNegative() *Negative

func (*Negative) AddNegative

func (i *Negative) AddNegative(dbName string, request *model.NegativeDoc) (string, error)

AddNegative 添加索引

func (*Negative) AllKeys

func (i *Negative) AllKeys(dbName string, request *model.NegSearch) ([]negative.KeyItem, error)

func (*Negative) BatchAddNegative

func (i *Negative) BatchAddNegative(dbName string, request *[]model.NegativeDoc) ([]string, error)

func (*Negative) HasNegative

func (i *Negative) HasNegative(dbName string, request *model.NegSearch) ([]negative.KeyItem, error)

func (*Negative) QueryNegative

func (i *Negative) QueryNegative(dbName string, request *model.NegSearch) (*model.NegResult, error)

func (*Negative) RemoveNegative

func (i *Negative) RemoveNegative(dbName string, request *model.RemoveNegativeModel) error

type Notice

type Notice struct {
	Text     string `json:"text"`
	ToUser   string `json:"to_user"`
	ToUserID string `json:"to_user_id"`
}

func NewNotice

func NewNotice() *Notice

func (*Notice) Notice

func (noc *Notice) Notice(w Notice) ([]string, error)

消息通知

type Word

type Word struct {
	Container *searcher.Container
}

func NewWord

func NewWord() *Word

func (*Word) WordCut

func (w *Word) WordCut(keyword string) []string

WordCut 分词

Jump to

Keyboard shortcuts

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