model

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: 2 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           string                 `json:"id,omitempty"`           //索引ID
	Title        string                 `json:"title,omitempty"`        //标题
	Text         string                 `json:"text,omitempty"`         //索引内容
	Flag         string                 `json:"flag,omitempty"`         //标识
	Time         string                 `json:"time,omitempty"`         //时间
	Tags         string                 `json:"tags,omitempty"`         //标签
	Seo          map[string]interface{} `json:"seo,omitempty"`          //补充关键词SEO关键词
	Keys         map[string]interface{} `json:"keys,omitempty"`         //补充关键词支持 如:site:test.com查询
	Cut_Document bool                   `json:"cut_document,omitempty"` //是否对文档进行索引
	Document     map[string]interface{} `json:"document,omitempty"`     //索引文档
}

IndexDoc 索引实体

type NegResult

type NegResult 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 []NegativeDoc `json:"documents,omitempty"` //文档
	Words     []string      `json:"words,omitempty"`     //搜索关键词
}

SearchResult 搜索响应

type NegSearch

type NegSearch struct {
	Query     string `json:"query,omitempty"`     // 搜索关键词
	Order     string `json:"order,omitempty"`     // 排序类型
	MaxLimit  int    `json:"maxlimit,omitempty"`  // 最大结果集限制,默认1000
	Flag      string `json:"flag,omitempty"`      // 搜索标记
	FilterExp string `json:"filterExp,omitempty"` // 过滤计算表达式
	ScoreExp  string `json:"scoreExp,omitempty"`  // 过滤计算表达式
	Page      int    `json:"page,omitempty"`      // 页码
	Limit     int    `json:"limit,omitempty"`     // 每页大小,最大1000,超过报错
}

NegRequest 搜索请求

func (*NegSearch) GetAndSetDefault

func (s *NegSearch) GetAndSetDefault() *NegSearch

type Neg_Option

type Neg_Option struct {
	Query   bool `json:"query"`   //关键词拦截
	Content bool `json:"content"` //结果负面过滤
}

type NegativeDoc

type NegativeDoc struct {
	Id    string   `json:"id,omitempty"`
	Title string   `json:"title,omitempty"`
	Text  string   `json:"text,omitempty"`
	Type  string   `json:"type,omitempty"`
	Keys  []string `json:"keys,omitempty"`
	Time  string   `json:"time,omitempty"`
}

type RemoveIndexModel

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

type RemoveNegativeModel

type RemoveNegativeModel struct {
	Id string `json:"id,omitempty"`
}

type ResponseDoc

type ResponseDoc struct {
	IndexDoc
	OriginalText  string   `json:"originalText,omitempty"`
	OriginalTitle string   `json:"originalTitle,omitempty"`
	Flag          string   `json:"flag,omitempty"`
	Time          string   `json:"time,omitempty"`
	Tags          string   `json:"tags,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"`   // 分数计算表达式
	MaxLimit  int        `json:"maxlimit,omitempty" form:"maxlimit"`   // 最大结果集限制,默认1000
	FilterExp string     `json:"filterExp,omitempty" form:"filterExp"` // 过滤计算表达式
	Negative  Neg_Option `json:"negative,omitempty"`                   // 负面项过滤开关
	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    string
	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