Documentation
¶
Index ¶
- type BulkIndexByScrollResponse
- type BulkResponse
- type Config
- type DeleteResponse
- type HitData
- type IService
- type IndexAliasResponse
- type IndexInfo
- type IndicesStatsResponse
- type InsertDoc
- type InsertResponse
- type Order
- type PerformRequestOptions
- type PerformResponse
- type QuerySqlResult
- type QuerySqlResultColumn
- type SearchResult
- type UpdateResponse
- type V7Service
- func (this_ *V7Service) BatchInsertNotWait(docs []*InsertDoc) (res *BulkResponse, err error)
- func (this_ *V7Service) Close()
- func (this_ *V7Service) CreateIndex(indexName string, bodyJSON map[string]interface{}) (err error)
- func (this_ *V7Service) Delete(indexName string, id string) (res *DeleteResponse, err error)
- func (this_ *V7Service) DeleteIndex(indexName string) (err error)
- func (this_ *V7Service) DeleteNotWait(indexName string, id string) (res *DeleteResponse, err error)
- func (this_ *V7Service) GetClient() (client *elastic.Client, err error)
- func (this_ *V7Service) GetMapping(indexName string) (res interface{}, err error)
- func (this_ *V7Service) IndexAlias(indexName string, aliasName string) (res *IndexAliasResponse, err error)
- func (this_ *V7Service) IndexStat(indexName string) (res *IndicesStatsResponse, err error)
- func (this_ *V7Service) Indexes() (indexes []*IndexInfo, err error)
- func (this_ *V7Service) Info() (res *elastic.NodesInfoResponse, err error)
- func (this_ *V7Service) Insert(indexName string, id string, doc interface{}) (res *InsertResponse, err error)
- func (this_ *V7Service) InsertNotWait(indexName string, id string, doc interface{}) (res *InsertResponse, err error)
- func (this_ *V7Service) PerformRequest(options PerformRequestOptions) (res *PerformResponse, err error)
- func (this_ *V7Service) PutMapping(indexName string, bodyJSON map[string]interface{}) (err error)
- func (this_ *V7Service) QuerySql(query string) (res *QuerySqlResult, err error)
- func (this_ *V7Service) Reindex(sourceIndexName string, toIndexName string) (res *BulkIndexByScrollResponse, err error)
- func (this_ *V7Service) Scroll(indexName string, scrollId string, pageSize int, whereList []*Where, ...) (res *SearchResult, err error)
- func (this_ *V7Service) Search(indexName string, pageIndex int, pageSize int, whereList []*Where, ...) (res *SearchResult, err error)
- func (this_ *V7Service) SetFieldType(indexName string, fieldName string, fieldType string) (err error)
- func (this_ *V7Service) Update(indexName string, id string, doc interface{}) (res *UpdateResponse, err error)
- func (this_ *V7Service) UpdateNotWait(indexName string, id string, doc interface{}) (res *UpdateResponse, err error)
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BulkIndexByScrollResponse ¶
type BulkIndexByScrollResponse struct {
*elastic.BulkIndexByScrollResponse
}
type BulkResponse ¶
type BulkResponse struct {
*elastic.BulkResponse
}
type Config ¶
type Config struct {
// Disabled 禁用 上层 初始化服务时候 可以判断该属性 如果为 配置 true 则不去初始化服务
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
Url string `json:"url,omitempty" yaml:"url,omitempty"`
Username string `json:"username,omitempty" yaml:"username,omitempty"`
Password string `json:"password,omitempty" yaml:"password,omitempty"`
CertPath string `json:"certPath,omitempty" yaml:"certPath,omitempty"`
}
type DeleteResponse ¶
type DeleteResponse struct {
*elastic.DeleteResponse
}
type HitData ¶
type HitData struct {
Index string `json:"_index,omitempty"` // index name
Type string `json:"_type,omitempty"` // type meta field
Id string `json:"_id,omitempty"` // external or internal
Uid string `json:"_uid,omitempty"` // uid meta field (see MapperService.java for all meta fields)
Version *int64 `json:"_version,omitempty"` // version number, when Version is set to true in SearchService
Source string `json:"_source,omitempty"` // stored document source
}
type IService ¶
type IService interface {
// Close 关闭 elasticsearch 客户端
Close()
// Info 获取 elasticsearch 信息
Info() (res *elastic.NodesInfoResponse, err error)
// DeleteIndex 删除 索引
DeleteIndex(indexName string) (err error)
// CreateIndex 创建 索引
CreateIndex(indexName string, bodyJSON map[string]interface{}) (err error)
// Indexes 查询 索引
Indexes() (indexes []*IndexInfo, err error)
// GetMapping 查询 索引 配置
GetMapping(indexName string) (res interface{}, err error)
// PutMapping 设置 索引 配置
PutMapping(indexName string, bodyJSON map[string]interface{}) (err error)
// SetFieldType 设置 索引 字段类型
SetFieldType(indexName string, fieldName string, fieldType string) (err error)
// Search 搜索
Search(indexName string, pageIndex int, pageSize int, whereList []*Where, orderList []*Order) (res *SearchResult, err error)
// Insert 插入数据 并且 等待刷新
Insert(indexName string, id string, doc interface{}) (res *InsertResponse, err error)
// InsertNotWait 插入数据 不 等待刷新
InsertNotWait(indexName string, id string, doc interface{}) (res *InsertResponse, err error)
// BatchInsertNotWait 批量插入数据 不 等待刷新
BatchInsertNotWait(docs []*InsertDoc) (res *BulkResponse, err error)
// Update 更新数据 并且 等待刷新
Update(indexName string, id string, doc interface{}) (res *UpdateResponse, err error)
// UpdateNotWait 更新数据 不 等待刷新
UpdateNotWait(indexName string, id string, doc interface{}) (res *UpdateResponse, err error)
// Delete 删除 并且 等待刷新
Delete(indexName string, id string) (res *DeleteResponse, err error)
// DeleteNotWait 删除 不 等待刷新
DeleteNotWait(indexName string, id string) (res *DeleteResponse, err error)
// Reindex 修改索引名称
Reindex(sourceIndexName string, toIndexName string) (res *BulkIndexByScrollResponse, err error)
// IndexStat 索引状态
IndexStat(indexName string) (res *IndicesStatsResponse, err error)
// Scroll 滚动查询
Scroll(indexName string, scrollId string, pageSize int, whereList []*Where, orderList []*Order) (res *SearchResult, err error)
// IndexAlias 索引别名
IndexAlias(indexName string, aliasName string) (res *IndexAliasResponse, err error)
PerformRequest(options PerformRequestOptions) (res *PerformResponse, err error)
QuerySql(query string) (res *QuerySqlResult, err error)
}
type IndexAliasResponse ¶
type IndexAliasResponse struct {
*elastic.AliasResult
}
type IndicesStatsResponse ¶
type IndicesStatsResponse struct {
*elastic.IndicesStatsResponse
}
type InsertResponse ¶
type InsertResponse struct {
*elastic.IndexResponse
}
type PerformRequestOptions ¶
type PerformRequestOptions struct {
elastic.PerformRequestOptions
}
type PerformResponse ¶
type QuerySqlResult ¶
type QuerySqlResult struct {
Columns []*QuerySqlResultColumn `json:"columns"`
Rows [][]interface{} `json:"rows"`
}
type QuerySqlResultColumn ¶
type SearchResult ¶
type SearchResult struct {
TotalHits *elastic.TotalHits `json:"total,omitempty"` // total number of hits found
MaxScore *float64 `json:"max_score,omitempty"` // maximum score of all hits
Hits []*HitData `json:"hits,omitempty"` // the actual hits returned
ScrollId string `json:"_scroll_id,omitempty"`
}
type UpdateResponse ¶
type UpdateResponse struct {
*elastic.UpdateResponse
}
type V7Service ¶
type V7Service struct {
*Config
// contains filtered or unexported fields
}
V7Service 注册处理器在线信息等
func (*V7Service) BatchInsertNotWait ¶
func (this_ *V7Service) BatchInsertNotWait(docs []*InsertDoc) (res *BulkResponse, err error)
func (*V7Service) CreateIndex ¶
func (*V7Service) Delete ¶
func (this_ *V7Service) Delete(indexName string, id string) (res *DeleteResponse, err error)
func (*V7Service) DeleteIndex ¶
func (*V7Service) DeleteNotWait ¶
func (this_ *V7Service) DeleteNotWait(indexName string, id string) (res *DeleteResponse, err error)
func (*V7Service) GetMapping ¶
func (*V7Service) IndexAlias ¶
func (this_ *V7Service) IndexAlias(indexName string, aliasName string) (res *IndexAliasResponse, err error)
func (*V7Service) IndexStat ¶
func (this_ *V7Service) IndexStat(indexName string) (res *IndicesStatsResponse, err error)
func (*V7Service) Insert ¶
func (this_ *V7Service) Insert(indexName string, id string, doc interface{}) (res *InsertResponse, err error)
func (*V7Service) InsertNotWait ¶
func (this_ *V7Service) InsertNotWait(indexName string, id string, doc interface{}) (res *InsertResponse, err error)
func (*V7Service) PerformRequest ¶
func (this_ *V7Service) PerformRequest(options PerformRequestOptions) (res *PerformResponse, err error)
func (*V7Service) PutMapping ¶
func (*V7Service) QuerySql ¶
func (this_ *V7Service) QuerySql(query string) (res *QuerySqlResult, err error)
func (*V7Service) Reindex ¶
func (this_ *V7Service) Reindex(sourceIndexName string, toIndexName string) (res *BulkIndexByScrollResponse, err error)
func (*V7Service) SetFieldType ¶
func (*V7Service) Update ¶
func (this_ *V7Service) Update(indexName string, id string, doc interface{}) (res *UpdateResponse, err error)
func (*V7Service) UpdateNotWait ¶
func (this_ *V7Service) UpdateNotWait(indexName string, id string, doc interface{}) (res *UpdateResponse, err error)
Click to show internal directories.
Click to hide internal directories.