model

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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Highlight

type Highlight struct {
	PreTag  string `json:"preTag"`  //高亮前缀
	PostTag string `json:"postTag"` //高亮后缀
}

Highlight 关键词高亮

type IndexDoc

type IndexDoc struct {
	Id       uint32                 `json:"id,omitempty"`
	Text     string                 `json:"text,omitempty"`
	Document map[string]interface{} `json:"document,omitempty"`
}

IndexDoc 索引实体

type RemoveIndexModel

type RemoveIndexModel struct {
	Id uint32 `json:"id,omitempty"`
}

type ResponseDoc

type ResponseDoc struct {
	IndexDoc
	OriginalText string   `json:"originalText,omitempty"`
	Score        int      `json:"score,omitempty"` //得分
	Keys         []string `json:"keys,omitempty"`
}

type ResponseDocSort

type ResponseDocSort []ResponseDoc

func (ResponseDocSort) Len

func (r ResponseDocSort) Len() int

func (ResponseDocSort) Less

func (r ResponseDocSort) Less(i, j int) bool

func (ResponseDocSort) Swap

func (r ResponseDocSort) Swap(i, j int)

type SearchRequest

type SearchRequest struct {
	Query     string     `json:"query,omitempty" form:"database"`     // 搜索关键词
	Order     string     `json:"order,omitempty" form:"database"`     // 排序类型
	ScoreExp  string     `json:"scoreExp,omitempty" form:"scoreExp"`  // 分数计算表达式
	Page      int        `json:"page,omitempty" form:"database"`      // 页码
	Limit     int        `json:"limit,omitempty" form:"database"`     // 每页大小,最大1000,超过报错
	Highlight *Highlight `json:"highlight,omitempty" form:"database"` // 关键词高亮
	Database  string     `json:"database" form:"database"`            // 数据库名字
}

SearchRequest 搜索请求

func (*SearchRequest) GetAndSetDefault

func (s *SearchRequest) GetAndSetDefault() *SearchRequest

type SearchResult

type SearchResult struct {
	Time      float64       `json:"time,omitempty"`      //查询用时
	Total     int           `json:"total"`               //总数
	PageCount int           `json:"pageCount"`           //总页数
	Page      int           `json:"page,omitempty"`      //页码
	Limit     int           `json:"limit,omitempty"`     //页大小
	Documents []ResponseDoc `json:"documents,omitempty"` //文档
	Words     []string      `json:"words,omitempty"`     //搜索关键词
}

SearchResult 搜索响应

type SliceItem

type SliceItem struct {
	Id    uint32
	Score int
}

type StorageIndexDoc

type StorageIndexDoc struct {
	*IndexDoc
	Keys []string `json:"keys,omitempty"`
}

StorageIndexDoc 文档对象

Jump to

Keyboard shortcuts

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