v7

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 *elasticV7.SearchService, aggs *querypara.Agg) (*elasticV7.SearchService, error)

Aggregation Aggregation

func Query

Types

type Decode

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

Decode source

type ESClientV7

type ESClientV7 struct {
	Host     string
	Prefix   string
	Version  int32
	Username string
	Password string
	Client   *elasticV7.Client
}

ESClient db handler

func NewESLongConnect

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

func NewESShortConnect

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

func (*ESClientV7) Agg

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

Agg Agg

func (*ESClientV7) BulkUpdate

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

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

func (*ESClientV7) Connect

func (cli *ESClientV7) Connect() error

func (*ESClientV7) Count

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

Count Count

func (*ESClientV7) Create

func (cli *ESClientV7) Create(name string, table, definition string) (bool, error)

Create adapter DBCreator

func (*ESClientV7) CreateIndex

func (cli *ESClientV7) CreateIndex(index string, _, mapping string) (bool, error)

CreateIndex create index

func (*ESClientV7) Delete

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

Delete adapter DBCreator

func (*ESClientV7) DeleteByQuery

func (cli *ESClientV7) DeleteByQuery(idx, _ string, query *querypara.Query) error

DeleteByQuery deletes documents that match a query.

func (*ESClientV7) DeleteIndex

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

DeleteIndex DeleteIndex

func (*ESClientV7) Exists

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

Exists adapter DBCreator

func (*ESClientV7) Get

func (cli *ESClientV7) Get(index, _, id string) (*json.RawMessage, error)

Get RawMessage

func (*ESClientV7) GetVersion

func (cli *ESClientV7) GetVersion() int32

func (*ESClientV7) IndexExists

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

IndexExists check index exists

func (*ESClientV7) List

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

List RawMessage

func (*ESClientV7) MGet

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

MGet MGet

func (*ESClientV7) PerformRequest

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

func (*ESClientV7) Search

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

Search Search

func (*ESClientV7) Set

func (cli *ESClientV7) Set(index, _, id string, value db.Record) error

Set db operator:

func (*ESClientV7) Status

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

Status 获取ES状态信息

func (*ESClientV7) Update

func (cli *ESClientV7) Update(index, _, 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