v6

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QueryFunc = "match_phase"

QueryFunc 需要根据需求调整 match_phase term match queryPara

Functions

func Aggregation

func Aggregation(search *elasticV6.SearchService, aggs *querypara.Agg) (*elasticV6.SearchService, error)

Aggregation Aggregation

func Query

Types

type Decode

type Decode func(x *json.RawMessage) (interface{}, error)

Decode source

type ESClientV6

type ESClientV6 struct {
	Host     string
	Prefix   string
	Version  int32
	Username string
	Password string
	Client   *elasticV6.Client
}

func NewESLongConnect

func NewESLongConnect(host string, prefix string, version int32, username, password string) (*ESClientV6, error)

func NewESShortConnect

func NewESShortConnect(host string, prefix string, version int32, username, password string) (*ESClientV6, error)

func (*ESClientV6) Agg

func (cli *ESClientV6) Agg(idx, typ string, query *querypara.Search) (*aggdecode.AggregationBucketKeyItem, error)

Agg Agg

func (*ESClientV6) BulkUpdate

func (cli *ESClientV6) BulkUpdate(rs []db.Record) error

BulkUpdate 一个区块对应的记录一起更新

func (*ESClientV6) Connect

func (cli *ESClientV6) Connect() error

func (*ESClientV6) Count

func (cli *ESClientV6) Count(idx, typ string, query *querypara.Query) (int64, error)

Count Count

func (*ESClientV6) Create

func (cli *ESClientV6) Create(name string, table, definitioin string) (bool, error)

Create adapter DBCreator

func (*ESClientV6) CreateIndex

func (cli *ESClientV6) CreateIndex(index string, typ, mapping string) (bool, error)

CreateIndex create index

func (*ESClientV6) Delete

func (cli *ESClientV6) Delete(name string) (bool, error)

Delete adapter DBCreator

func (*ESClientV6) DeleteByQuery

func (cli *ESClientV6) DeleteByQuery(idx, typ string, query *querypara.Query) error

DeleteByQuery deletes documents that match a query.

func (*ESClientV6) DeleteIndex

func (cli *ESClientV6) DeleteIndex(index string) (bool, error)

DeleteIndex DeleteIndex

func (*ESClientV6) Exists

func (cli *ESClientV6) Exists(name string) (bool, error)

Exists adapter DBCreator

func (*ESClientV6) Get

func (cli *ESClientV6) Get(index, typ, id string) (*json.RawMessage, error)

Get RawMessage

func (*ESClientV6) GetVersion

func (cli *ESClientV6) GetVersion() int32

func (*ESClientV6) IndexExists

func (cli *ESClientV6) IndexExists(index string) (bool, error)

IndexExists check index exists

func (*ESClientV6) List

func (cli *ESClientV6) List(index, typ string, kv []*db.ListKV) ([]*json.RawMessage, error)

List RawMessage

func (*ESClientV6) MGet

func (cli *ESClientV6) MGet(idx, typ string, ids []string, decode func(x *json.RawMessage) (interface{}, error)) ([]interface{}, error)

MGet MGet

func (*ESClientV6) PerformRequest

func (cli *ESClientV6) PerformRequest(method, path string, params url.Values, body interface{}, headers http.Header) (interface{}, error)

func (*ESClientV6) Search

func (cli *ESClientV6) Search(idx, typ string, query *querypara.Query, decode func(x *json.RawMessage) (interface{}, error)) ([]interface{}, error)

Search Search

func (*ESClientV6) Set

func (cli *ESClientV6) Set(index, typ, id string, value db.Record) error

Set db operator:

func (*ESClientV6) Status

func (cli *ESClientV6) Status() (res *status.Status)

Status 获取ES状态信息

func (*ESClientV6) Update

func (cli *ESClientV6) Update(index, typ, id string, value string) error

Update db operator

Jump to

Keyboard shortcuts

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