Documentation ¶
Index ¶
- type Elasticsearch
- func (e *Elasticsearch) AddRecord(index string, id int, title, remark, textData, tags string) (string, error)
- func (e *Elasticsearch) DeleteRecord(index string, id int) error
- func (e *Elasticsearch) GetRecord(index string, id int) (*Knowledge, error)
- func (e *Elasticsearch) PageRecord(index string, size int, page int, keyword string) (int64, []int, error)
- func (e *Elasticsearch) RecordList(index string, keyword string) ([]int, error)
- func (e *Elasticsearch) UpdateRecord(index string, id int, title, remark, textData, tags string) error
- type EsOption
- type Knowledge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elasticsearch ¶
type Elasticsearch struct { Client *elastic.Client Options *EsOption }
func NewEs ¶
func NewEs(esCli *elastic.Client, options *EsOption) (*Elasticsearch, error)
func (*Elasticsearch) AddRecord ¶
func (e *Elasticsearch) AddRecord(index string, id int, title, remark, textData, tags string) (string, error)
添加记录
func (*Elasticsearch) DeleteRecord ¶
func (e *Elasticsearch) DeleteRecord(index string, id int) error
删除一条
func (*Elasticsearch) GetRecord ¶
func (e *Elasticsearch) GetRecord(index string, id int) (*Knowledge, error)
查询记录
func (*Elasticsearch) PageRecord ¶
func (e *Elasticsearch) PageRecord(index string, size int, page int, keyword string) (int64, []int, error)
分页
func (*Elasticsearch) RecordList ¶ added in v1.2.2
func (e *Elasticsearch) RecordList(index string, keyword string) ([]int, error)
列表
func (*Elasticsearch) UpdateRecord ¶
func (e *Elasticsearch) UpdateRecord(index string, id int, title, remark, textData, tags string) error
修改
Click to show internal directories.
Click to hide internal directories.