Documentation ¶
Index ¶
- type GoEs
- func (cli *GoEs) Client() *elasticsearch.Client
- func (cli *GoEs) DeleteIndex(indexes []string) (*esapi.Response, error)
- func (cli *GoEs) DocBatchCreate(index string, data map[string]interface{}) (err error)
- func (cli *GoEs) DocBatchDelete(index string, ids []string) (total int64, err error)
- func (cli *GoEs) DocCreate(index, docId string, document interface{}) (*esapi.Response, error)
- func (cli *GoEs) DocDelete(index, id string) (*esapi.Response, error)
- func (cli *GoEs) DocDeleteBy(index string, query string) (*esapi.Response, error)
- func (cli *GoEs) DocExists(index, id string) (bool, error)
- func (cli *GoEs) DocGet(index, id string, m interface{}) (bool, error)
- func (cli *GoEs) DocMultiGet(index string, ids []string, p *Pagination) (*search.Response, error)
- func (cli *GoEs) DocSearch(index string, query types.Query, p *Pagination) (*search.Response, error)
- func (cli *GoEs) DocSearchAll(index string, p *Pagination) (*search.Response, error)
- func (cli *GoEs) DocSearchBoolQuery(terms map[string]interface{}) types.Query
- func (cli *GoEs) DocSearchExistsQuery(field string) types.Query
- func (cli *GoEs) DocSearchMatchQuery(field string, value string) types.Query
- func (cli *GoEs) DocSearchScriptQuery(script types.Script) types.Query
- func (cli *GoEs) DocSearchTermQuery(field string, value any) types.Query
- func (cli *GoEs) DocSearchTermsQuery(field string, values []interface{}) types.Query
- func (cli *GoEs) DocUpdate(index, docId string, document interface{}) (*esapi.Response, error)
- func (cli *GoEs) TypeClient() *elasticsearch.TypedClient
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoEs ¶
type GoEs struct {
// contains filtered or unexported fields
}
func (*GoEs) DeleteIndex ¶
删除 - 根据IDS - Deleting an index
func (*GoEs) DocBatchCreate ¶
文档 - 批量添加
func (*GoEs) DocBatchDelete ¶
文档 - 批量删除
func (*GoEs) DocDeleteBy ¶
文档 - 删除 - 根据条件 即时没有符合条件的文档,也不会报404错误
func (*GoEs) DocMultiGet ¶
文档 - 查询文档 - 根据ID集合
func (*GoEs) DocSearch ¶
func (cli *GoEs) DocSearch(index string, query types.Query, p *Pagination) (*search.Response, error)
文档 - 搜索文档 - 根据条件
func (*GoEs) DocSearchAll ¶
query := `{ "query": { "match_all": {} } }`
func (*GoEs) DocSearchBoolQuery ¶
func (*GoEs) DocSearchExistsQuery ¶
文档 - 搜索条件 - 判断某个字段是否存在
func (*GoEs) DocSearchMatchQuery ¶
文档 - 搜索条件 - 匹配查找,单字段搜索(匹配分词结果)
func (*GoEs) DocSearchScriptQuery ¶
文档 - 搜索条件 - 脚本查询
func (*GoEs) DocSearchTermQuery ¶
文档 - 搜索条件 - 精确匹配单个字段
func (*GoEs) DocSearchTermsQuery ¶
文档 - 搜索条件 - 精确匹配多个字段
func (*GoEs) DocUpdate ¶
Updating documents client.Update("my_index", "id", strings.NewReader(`{doc: { language: "Go" }}`))
func (*GoEs) TypeClient ¶
func (cli *GoEs) TypeClient() *elasticsearch.TypedClient
type Pagination ¶
Click to show internal directories.
Click to hide internal directories.