Documentation ¶
Index ¶
- Variables
- func Aggregation(search *elasticV7.SearchService, aggs *querypara.Agg) (*elasticV7.SearchService, error)
- func Query(search *elasticV7.SearchService, query *querypara.Query) (*elasticV7.SearchService, error)
- type Decode
- type ESClientV7
- func (cli *ESClientV7) Agg(idx, typ string, query *querypara.Search) (*aggdecode.AggregationBucketKeyItem, error)
- func (cli *ESClientV7) BulkUpdate(rs []db.Record) error
- func (cli *ESClientV7) Connect() error
- func (cli *ESClientV7) Count(idx, typ string, query *querypara.Query) (int64, error)
- func (cli *ESClientV7) Create(name string, table, definition string) (bool, error)
- func (cli *ESClientV7) CreateIndex(index string, _, mapping string) (bool, error)
- func (cli *ESClientV7) Delete(name string) (bool, error)
- func (cli *ESClientV7) DeleteByQuery(idx, _ string, query *querypara.Query) error
- func (cli *ESClientV7) DeleteIndex(index string) (bool, error)
- func (cli *ESClientV7) Exists(name string) (bool, error)
- func (cli *ESClientV7) Get(index, _, id string) (*json.RawMessage, error)
- func (cli *ESClientV7) GetVersion() int32
- func (cli *ESClientV7) IndexExists(index string) (bool, error)
- func (cli *ESClientV7) List(index, _ string, kv []*db.ListKV) ([]*json.RawMessage, error)
- func (cli *ESClientV7) MGet(idx, typ string, ids []string, ...) ([]interface{}, error)
- func (cli *ESClientV7) PerformRequest(method, path string, params url.Values, body interface{}, headers http.Header) (interface{}, error)
- func (cli *ESClientV7) Search(idx, typ string, query *querypara.Query, ...) ([]interface{}, error)
- func (cli *ESClientV7) Set(index, _, id string, value db.Record) error
- func (cli *ESClientV7) Status() (res *status.Status)
- func (cli *ESClientV7) Update(index, _, id string, value string) error
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 ¶
func Query(search *elasticV7.SearchService, query *querypara.Query) (*elasticV7.SearchService, error)
Types ¶
type ESClientV7 ¶
type ESClientV7 struct { Host string Prefix string Version int32 Username string Password string Client *elasticV7.Client }
ESClient db handler
func NewESLongConnect ¶
func NewESShortConnect ¶
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) 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 (*ESClientV7) Search ¶
func (cli *ESClientV7) Search(idx, typ string, query *querypara.Query, decode func(x *json.RawMessage) (interface{}, error)) ([]interface{}, error)
Search Search
Click to show internal directories.
Click to hide internal directories.