elasticsearch

package
v1.5.28 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTrace

func SetTrace(t bool)

SetTrace 设置跟踪

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client --

func NewClient

func NewClient(config elasticsearch.Config) *Client

NewClient --

func (*Client) Create

func (client *Client) Create(ctx context.Context, index, id string, doc interface{}) (*IndexResponse, error)

Create --

func (*Client) Delete

func (client *Client) Delete(ctx context.Context, index, id string) (*IndexResponse, error)

Delete --

func (*Client) Get

func (client *Client) Get(ctx context.Context, index, id string, response interface{}) error

Get --

func (*Client) Index

func (client *Client) Index(ctx context.Context, index, id string, doc interface{}) (*IndexResponse, error)

Index --

func (*Client) Search

func (client *Client) Search(ctx context.Context, index string, query interface{}, response interface{}) error

Search --

func (*Client) Update

func (client *Client) Update(ctx context.Context, index, id string, doc interface{}) (*IndexResponse, error)

Update --

type Doc

type Doc struct {
	Index string  `json:"_index"`
	Type  string  `json:"_type"`
	ID    string  `json:"_id"`
	Score float64 `json:"_score"`
}

Doc --

type IndexResponse

type IndexResponse struct {
	HTTPStatusCode int    `json:"httpStatusCode"`
	Index          string `json:"_index"`
	Type           string `json:"_type"`
	ID             string `json:"_id"`
	Version        int    `json:"_version"`
	Result         string `json:"result"`
}

IndexResponse --

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy 代理

func NewProxy

func NewProxy() *Proxy

NewProxy 代理池

func (*Proxy) NameSpace

func (proxy *Proxy) NameSpace(group string) *Client

NameSpace 获取分组

func (*Proxy) SetNameSpace

func (proxy *Proxy) SetNameSpace(group string, client *Client)

SetNameSpace 设置组

type SearchHits

type SearchHits struct {
	Total struct {
		Value    int    `json:"value"`
		Relation string `json:"relation"`
	} `json:"total"`
	MaxScore float64 `json:"max_score"`
}

SearchHits --

type SearchResponse

type SearchResponse struct {
	Took     int  `json:"took"`
	TimedOut bool `json:"timed_out"`
}

SearchResponse --

Jump to

Keyboard shortcuts

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