pagereq

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 22 Imported by: 0

README

通用ES接口封装

cmdrequest

keywordrequest

metadatarequest

queryrequest

Documentation

Index

Constants

Term-level queries exists query 字段是否存在值 fuzzy query 模糊查询 ids query ID 查询 prefix query 前缀查询 range query 范围查询 regexp query 正则查询 term query 精确匹配单个字段 terms query 精确匹配单个字段,但使用多值进行匹配,类似于 SQL 中的 in 操作 terms_set query 字段集合查询。文档需包含字段集合中指定的最少数量字段 wildcard query 通配符查询 Full-text queries match query 单字段搜索(匹配分词结果,不需要全文匹配) Specialized queries script query 脚本查询

Variables

This section is empty.

Functions

func InjectCmdRequest

func InjectCmdRequest(s *CmdRequest)

func InjectIchubQueryRequest

func InjectIchubQueryRequest(s *QueryRequest)

func LoadCmdRequest

func LoadCmdRequest() baseiface.ISingleton

func LoadIchubQueryRequest

func LoadIchubQueryRequest() baseiface.ISingleton

Types

type CmdRequest

type CmdRequest struct {
	*cmddto.CmdDto
	*QueryRequest
}

func DefaultCmd

func DefaultCmd() *CmdRequest

func FindBeanCmdRequest

func FindBeanCmdRequest() *CmdRequest

func NewCmdRequest

func NewCmdRequest() *CmdRequest

func (*CmdRequest) BulkCreate

func (self *CmdRequest) BulkCreate() (*elastic.BulkResponse, error)

Execute

https://apim.docs.wso2.com/en/latest/design/advanced-topics/enabling-cors-for-apis/

func (*CmdRequest) BulkDelete

func (self *CmdRequest) BulkDelete() (int, error)

func (*CmdRequest) BulkDocAsUpsert

func (self *CmdRequest) BulkDocAsUpsert() (*elastic.BulkResponse, error)

func (*CmdRequest) BulkIndex

func (self *CmdRequest) BulkIndex() (*elastic.BulkResponse, error)

func (*CmdRequest) BulkScriptUpsert

func (self *CmdRequest) BulkScriptUpsert() (*elastic.BulkResponse, error)

func (*CmdRequest) BulkUpdate

func (self *CmdRequest) BulkUpdate() (*elastic.BulkResponse, error)

Add(elastic.NewBulkUpdateRequest().Id(this.Id).Doc(this.Doc)).

func (*CmdRequest) CopyFromDb

func (self *CmdRequest) CopyFromDb(tableName string, pkField ...string) error

func (*CmdRequest) Delete

func (self *CmdRequest) Delete() (*elastic.DeleteResponse, error)

func (*CmdRequest) DeleteByQuery

func (self *CmdRequest) DeleteByQuery() (int64, error)

func (*CmdRequest) DocAsUpsert

func (self *CmdRequest) DocAsUpsert() (*elastic.UpdateResponse, error)

func (*CmdRequest) Execute

func (self *CmdRequest) Execute() *basedto.IchubResult

func (*CmdRequest) InsertIfNotExists

func (self *CmdRequest) InsertIfNotExists() *basedto.IchubResult

func (*CmdRequest) Query2QueryRequest

func (self *CmdRequest) Query2QueryRequest(q elastic.Query) (*QueryRequest, error)

func (*CmdRequest) QueryRequestFrom

func (self *CmdRequest) QueryRequestFrom(q elastic.Query) error

func (*CmdRequest) SaveIndex

func (self *CmdRequest) SaveIndex(id string, model interface{}) (*elastic.IndexResponse, error)

func (*CmdRequest) SaveIndexData

func (self *CmdRequest) SaveIndexData() (*elastic.IndexResponse, error)

func (*CmdRequest) Script2Dto

func (self *CmdRequest) Script2Dto(script *elastic.Script) *cmddto.EsScriptDto

func (*CmdRequest) SetIndexName

func (self *CmdRequest) SetIndexName(IndexName string) *CmdRequest

func (*CmdRequest) Update

func (self *CmdRequest) Update() (*elastic.UpdateResponse, error)

func (*CmdRequest) UpdateByQuery

func (self *CmdRequest) UpdateByQuery() (*elastic.BulkIndexByScrollResponse, error)

func (*CmdRequest) Upsert

func (self *CmdRequest) Upsert() (*elastic.UpdateResponse, error)

type KeyWorkRequest

type KeyWorkRequest struct {
	esdto.EsRequest
	Tokenizer string
	Text      string
}

func DefaultKeyword

func DefaultKeyword() *KeyWorkRequest

func NewKeyworkRequest

func NewKeyworkRequest() *KeyWorkRequest

func (*KeyWorkRequest) Analyze

func (this *KeyWorkRequest) Analyze() (*elastic.IndicesAnalyzeResponse, error)

func (*KeyWorkRequest) Execute

func (this *KeyWorkRequest) Execute() (interface{}, error)

func (*KeyWorkRequest) IndexAnalyze

func (this *KeyWorkRequest) IndexAnalyze(text string) (*elastic.IndicesAnalyzeResponse, error)

func (*KeyWorkRequest) IndexAnalyzeToken

func (this *KeyWorkRequest) IndexAnalyzeToken(token string, text string) (*elastic.IndicesAnalyzeResponse, error)

func (*KeyWorkRequest) IndexAnalyzeWord

func (this *KeyWorkRequest) IndexAnalyzeWord(r *splitword.SplitWordRequest) (*elastic.IndicesAnalyzeResponse, error)

type MetadataRequest

type MetadataRequest struct {
	esdto.EsRequest
	Fields   map[string]string `json:"fields"`
	Mappings string            `json:"mappings"`
}

func DefaultMetadata

func DefaultMetadata() *MetadataRequest

func NewMetadataRequest

func NewMetadataRequest() *MetadataRequest

func (*MetadataRequest) CreateAlias

func (this *MetadataRequest) CreateAlias() (*basedto.IchubResult, error)

func (*MetadataRequest) CreateIndex

func (this *MetadataRequest) CreateIndex() (bool, error)

func (*MetadataRequest) CreateIndexMapping

func (this *MetadataRequest) CreateIndexMapping(mapping string) (bool, error)

func (*MetadataRequest) DefineIndexField

func (this *MetadataRequest) DefineIndexField(name, Type string)

func (*MetadataRequest) DropIndex

func (this *MetadataRequest) DropIndex() (*elastic.IndicesDeleteResponse, error)

func (*MetadataRequest) Execute

func (this *MetadataRequest) Execute() (interface{}, error)

func (*MetadataRequest) GetMapping

func (this *MetadataRequest) GetMapping() (map[string]any, error)

func (*MetadataRequest) IndexExist

func (this *MetadataRequest) IndexExist() (bool, error)

func (*MetadataRequest) ToMetadata

func (this *MetadataRequest) ToMetadata() *indexmeta.EsIndexMeta

type QueryRequest

type QueryRequest struct {
	*pagees.PageEsRequest
	// contains filtered or unexported fields
}

func Default

func Default() *QueryRequest

func FindBeanIchubQueryRequest

func FindBeanIchubQueryRequest() *QueryRequest

func New

func New(pageSize, pageCurrent int) *QueryRequest

func NewQueryRequest

func NewQueryRequest() *QueryRequest

func (*QueryRequest) Aggregation

func (self *QueryRequest) Aggregation(name string, aggregation elastic.Aggregation) *QueryRequest

func (*QueryRequest) Check

func (self *QueryRequest) Check() error

func (*QueryRequest) EsStats

func (self *QueryRequest) EsStats(statField string, size ...int) *QueryRequest

func (*QueryRequest) Execute

func (qr *QueryRequest) Execute() (*pagees.PageEsResult, error)

func (*QueryRequest) Filter

func (qr *QueryRequest) Filter() (*pagees.PageEsResult, error)

func (*QueryRequest) Get

func (qr *QueryRequest) Get() *basedto.IchubResult

func (*QueryRequest) Get2PageEsResult

func (qr *QueryRequest) Get2PageEsResult() *pagees.PageEsResult

func (*QueryRequest) IfGet

func (qr *QueryRequest) IfGet() bool

func (*QueryRequest) IfQuery

func (qr *QueryRequest) IfQuery() bool

func (*QueryRequest) IfServerHttpcliBodyEmpty

func (self *QueryRequest) IfServerHttpcliBodyEmpty() bool

func (*QueryRequest) IsMust

func (qr *QueryRequest) IsMust() bool

func (*QueryRequest) Models

func (self *QueryRequest) Models() any

func (*QueryRequest) Must

func (qr *QueryRequest) Must() (*pagees.PageEsResult, error)

func (*QueryRequest) MustNot

func (qr *QueryRequest) MustNot() (*pagees.PageEsResult, error)

func (*QueryRequest) Query

func (qr *QueryRequest) Query() (*pagees.PageEsResult, error)

func (*QueryRequest) QuerySource

func (self *QueryRequest) QuerySource() *pagees.PageEsResult

func (*QueryRequest) QuerySourceAs

func (self *QueryRequest) QuerySourceAs(models any) *pagees.PageEsResult

func (*QueryRequest) QuerySourceBody

func (self *QueryRequest) QuerySourceBody() *QueryRequest

func (*QueryRequest) SearchSources

func (self *QueryRequest) SearchSources() map[string]any

func (*QueryRequest) SetIndexAlias

func (self *QueryRequest) SetIndexAlias(alias string) *QueryRequest

func (*QueryRequest) SetIndexName

func (self *QueryRequest) SetIndexName(IndexName string) *QueryRequest

func (*QueryRequest) SetModels

func (self *QueryRequest) SetModels(models any)

func (*QueryRequest) SetPageCurrent

func (self *QueryRequest) SetPageCurrent(PageCurrent int) *QueryRequest

func (*QueryRequest) SetPageSize

func (self *QueryRequest) SetPageSize(PageSize int) *QueryRequest

func (*QueryRequest) SetPretty

func (self *QueryRequest) SetPretty(pretty bool) *QueryRequest

func (*QueryRequest) SetQueryEmpty

func (this *QueryRequest) SetQueryEmpty(queryEmpty bool) *QueryRequest

func (*QueryRequest) SetQueryZero

func (this *QueryRequest) SetQueryZero(queryEmpty bool) *QueryRequest

func (*QueryRequest) SetSearchSources

func (self *QueryRequest) SetSearchSources(key string, value any) *QueryRequest

func (*QueryRequest) SetSource

func (self *QueryRequest) SetSource(Source string) *QueryRequest

func (*QueryRequest) Should

func (qr *QueryRequest) Should() (*pagees.PageEsResult, error)

func (*QueryRequest) Sort2Source

func (self *QueryRequest) Sort2Source(v []elastic.Sorter) *QueryRequest

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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