Documentation ¶
Index ¶
- Constants
- func NewMapping(mp MappingPayload) string
- type Base
- type Es
- func (es *Es) BulkDelete(ctx context.Context, ids []string) error
- func (es *Es) BulkSaveOrUpdate(ctx context.Context, docs []interface{}) error
- func (es *Es) CheckTypeExists(ctx context.Context) (b bool, err error)
- func (es *Es) ClearIndex(ctx context.Context) error
- func (es *Es) Count(ctx context.Context, paging *Paging) (int64, error)
- func (es *Es) DeleteIndex(ctx context.Context) error
- func (es *Es) GetByID(ctx context.Context, id string) (map[string]interface{}, error)
- func (es *Es) List(ctx context.Context, paging *Paging, ...) ([]interface{}, error)
- func (es *Es) NewIndex(ctx context.Context, mapping string) (exists bool, err error)
- func (es *Es) Page(ctx context.Context, paging *Paging) (PageResult, error)
- func (es *Es) PutMapping(ctx context.Context, mp MappingPayload) error
- func (es *Es) Random(ctx context.Context, paging *Paging) ([]map[string]interface{}, error)
- func (es *Es) SaveOrUpdate(ctx context.Context, doc interface{}) (string, error)
- func (e *Es) SetIndex(index string)
- func (e *Es) SetType(estype string)
- func (es *Es) Stat(ctx context.Context, paging *Paging, aggr interface{}) (map[string]interface{}, error)
- type EsOption
- type Field
- type IBase
- type MappingPayload
- type PageResult
- type Paging
- type QueryCond
- type Sort
Constants ¶
View Source
const ( SHOULD queryLogic = iota + 1 MUST MUSTNOT )
View Source
const ( TERMS queryType = iota + 1 MATCHPHRASE RANGE PREFIX // https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-wildcard-query.html WILDCARD // https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-prefix-query.html EXISTS )
View Source
const ( TEXT esFieldType = "text" KEYWORD esFieldType = "keyword" DATE esFieldType = "date" LONG esFieldType = "long" INTEGER esFieldType = "integer" SHORT esFieldType = "short" DOUBLE esFieldType = "double" FLOAT esFieldType = "float" BOOL esFieldType = "boolean" )
Variables ¶
This section is empty.
Functions ¶
func NewMapping ¶
func NewMapping(mp MappingPayload) string
Types ¶
type Es ¶
type Es struct {
// contains filtered or unexported fields
}
func (*Es) BulkSaveOrUpdate ¶
func (*Es) PutMapping ¶
func (es *Es) PutMapping(ctx context.Context, mp MappingPayload) error
func (*Es) SaveOrUpdate ¶
type EsOption ¶
type EsOption func(*Es)
func WithClient ¶
func WithLogger ¶
func WithPassword ¶
func WithUsername ¶
type MappingPayload ¶
type PageResult ¶
Click to show internal directories.
Click to hide internal directories.