Documentation
¶
Index ¶
- Constants
- func String(v interface{}, err error) (string, error)
- type BulkRequest
- type BulkResult
- type Client
- func (c *Client) AddAliasAndDeleteIndex(newIndex string, alias string) (bool, error)
- func (c *Client) BulkIndex(batchSize int, bulkRequests []*BulkRequest) (result *BulkResult)
- func (c *Client) Delete(index string, id string) error
- func (c *Client) DeleteIndex(index string) (bool, error)
- func (c *Client) Exists(index string, id string) bool
- func (c *Client) GetDocumentById(index string, id string, v interface{}) error
- func (c *Client) GetDocumentByQuery(ctx context.Context, index string, query map[string]interface{}, v interface{}) (*string, error)
- func (c *Client) GetDocumentField(index string, id string, key string) (interface{}, error)
- func (c *Client) Index(index string, id string, v interface{}) error
- func (c *Client) Search(ctx context.Context, index string, query string) (*ElasticSearchResult, error)
- func (c *Client) Update(index string, id string, v interface{}) error
- type ElasticAggregateBucket
- type ElasticResultHit
- type ElasticResultHits
- type ElasticResultShards
- type ElasticResultTotal
- type ElasticSearchResult
Constants ¶
View Source
const (
TimeLayout = "20060102150405"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BulkRequest ¶
type BulkResult ¶
func (*BulkResult) AppendError ¶
func (bres *BulkResult) AppendError(format string, a ...interface{})
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddAliasAndDeleteIndex ¶
func (*Client) BulkIndex ¶
func (c *Client) BulkIndex(batchSize int, bulkRequests []*BulkRequest) (result *BulkResult)
https://github.com/elastic/go-elasticsearch/blob/example_bulk/_examples/bulk/bulk.go
func (*Client) GetDocumentById ¶
func (*Client) GetDocumentByQuery ¶
func (*Client) GetDocumentField ¶
type ElasticAggregateBucket ¶
type ElasticAggregateBucket struct { DocCount int `json:"doc_count"` Key interface{} `json:"key"` }
type ElasticResultHit ¶
type ElasticResultHit struct { Index string `json:"_index"` Type string `json:"_type"` ID string `json:"_id"` Score float64 `json:"_score"` Source json.RawMessage `json:"_source"` Fields json.RawMessage `json:"fields,omitempty"` Sort []int64 `json:"sort,omitempty"` }
type ElasticResultHits ¶
type ElasticResultHits struct { Total ElasticResultTotal `json:"total"` MaxScore float64 `json:"max_score"` Hits []ElasticResultHit `json:"hits"` }
type ElasticResultShards ¶
type ElasticResultTotal ¶
type ElasticSearchResult ¶
type ElasticSearchResult struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Shards ElasticResultShards `json:"_shards"` Hits ElasticResultHits `json:"hits"` Aggregations json.RawMessage `json:"aggregations"` }
Click to show internal directories.
Click to hide internal directories.