Documentation ¶
Index ¶
- Constants
- func GenUUID() string
- func IsIndexAreadyExists(err error) bool
- func IsNotFound(err error) bool
- type BulkDeleteError
- type BulkError
- type BulkResult
- type ES
- func (es *ES) BulkCreate(path string, data [][2]interface{}) error
- func (es *ES) BulkDelete(path string, data []string) error
- func (es *ES) BulkDo(path string, body, typ string, data [][2]interface{}) error
- func (es *ES) BulkIndex(path string, data [][2]interface{}) error
- func (es *ES) BulkUpdate(path string, data [][2]interface{}) error
- func (es *ES) Create(path string, bodyData, data interface{}) error
- func (es *ES) Delete(path string, data interface{}) error
- func (es *ES) Ensure(path string, def interface{}) error
- func (es *ES) Exist(path string) (bool, error)
- func (es *ES) Get(path string, bodyData, data interface{}) error
- func (es *ES) Post(path string, bodyData, data interface{}) error
- func (es *ES) Put(path string, bodyData, data interface{}) error
- func (es *ES) RootGet(path string, bodyData, data interface{}) error
- func (es *ES) RootPost(path string, bodyData, data interface{}) error
- func (es *ES) RootUri(path string) (string, error)
- func (es *ES) Search(path string, bodyData interface{}) (*SearchResult, error)
- func (es *ES) Update(path string, bodyData, data interface{}) error
- func (es *ES) Uri(path string) string
- type Error
- type SearchHit
- type SearchHits
- type SearchResult
- type Shards
Constants ¶
View Source
const ( ErrorNotFound = iota ErrorIndexAreadyExists )
Variables ¶
This section is empty.
Functions ¶
func IsIndexAreadyExists ¶
func IsNotFound ¶
Types ¶
type BulkDeleteError ¶
type BulkResult ¶
type BulkResult struct { Errors bool `json:"errors"` Items []map[string]map[string]interface{} `json:"items"` }
reference: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
type ES ¶
type ES struct { BaseAddrs []string // contains filtered or unexported fields }
func (*ES) BulkCreate ¶
func (*ES) BulkUpdate ¶
type SearchHits ¶
type SearchHits struct { Total struct { Value int `json:"value"` Relation string `json:"relation"` } `json:"total"` Hits []SearchHit `json:"hits"` }
func (SearchHits) Ids ¶
func (h SearchHits) Ids() (data []string)
func (SearchHits) SetIds ¶
func (h SearchHits) SetIds(data interface{}, key string)
func (SearchHits) Sources ¶
func (h SearchHits) Sources(data interface{}) error
func (SearchHits) SourcesWithId ¶
func (h SearchHits) SourcesWithId(data interface{}, key string) error
type SearchResult ¶
type SearchResult struct { Took int `json:"took"` Timeout bool `json:"time_out"` Shards Shards `json:"_shards"` Hits SearchHits `json:"hits"` Aggregations json.RawMessage `json:"aggregations"` }
Click to show internal directories.
Click to hide internal directories.