Documentation ¶
Index ¶
- Variables
- type Elastic
- func (self *Elastic) CreateIndex(index string) bool
- func (self *Elastic) CreateIndexAndMapping(index, mapping string) bool
- func (self *Elastic) Del(index, typ, id string) bool
- func (self *Elastic) DelIndex(index string) bool
- func (self *Elastic) JsonMap(index, typ, query string, fields []string, from, size int, ...) map[string]interface{}
- func (self *Elastic) MultiMatchQueryBestFields(index, typ, text string, start, end int, fields ...string) *elastic.SearchResult
- func (self *Elastic) Put(index, typ, id, bodyJson string) bool
- func (self *Elastic) PutAny(index, typ, id string, body interface{}) bool
- func (self *Elastic) QueryString(index, typ, query string, size int) *elastic.SearchResult
- func (self *Elastic) QueryStringMap(index, typ, query string, start, end int) map[string]interface{}
- func (self *Elastic) QueryStringRandomSearch(client *elastic.Client, index, typ, query string, size int) *elastic.SearchResult
- func (self *Elastic) RangeQueryLoginDate(index string, typ string, start, end int) *elastic.SearchResult
- func (self *Elastic) TermQuery(index, typ string, term *elastic.TermQuery, start, end int) *elastic.SearchResult
- func (self *Elastic) Update(index, typ, id string, updateMap map[string]interface{}) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ElasticPool = make(map[string]*Elastic)
)
es 缓存池
Functions ¶
This section is empty.
Types ¶
type Elastic ¶
type Elastic struct { Client *elastic.Client // contains filtered or unexported fields }
func (*Elastic) CreateIndexAndMapping ¶
新建索引
func (*Elastic) MultiMatchQueryBestFields ¶
func (self *Elastic) MultiMatchQueryBestFields(index, typ, text string, start, end int, fields ...string) *elastic.SearchResult
多条件参考:https://stackoverflow.com/questions/49942373/golang-elasticsearch-multiple-query-parameters
func (*Elastic) QueryString ¶
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html
func (*Elastic) QueryStringMap ¶
func (*Elastic) QueryStringRandomSearch ¶
func (*Elastic) RangeQueryLoginDate ¶
Click to show internal directories.
Click to hide internal directories.