Documentation ¶
Index ¶
- type Elasticsearch
- func (e *Elasticsearch) AddRecord(id int, title, remark, textData, tags string) (string, error)
- func (e *Elasticsearch) DeleteRecord(id int) error
- func (e *Elasticsearch) GetRecord(id int) (*Knowledge, error)
- func (e *Elasticsearch) PageRecord(size int, page int, keyword string) ([]int, error)
- func (e *Elasticsearch) UpdateRecord(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(id int, title, remark, textData, tags string) (string, error)
添加记录
func (*Elasticsearch) GetRecord ¶
func (e *Elasticsearch) GetRecord(id int) (*Knowledge, error)
查询记录
func (*Elasticsearch) PageRecord ¶
分页
func (*Elasticsearch) UpdateRecord ¶
func (e *Elasticsearch) UpdateRecord(id int, title, remark, textData, tags string) error
修改
Click to show internal directories.
Click to hide internal directories.