Documentation ¶
Overview ¶
This file is auto-generated, don't edit it. Thanks.
Index ¶
- type Client
- func (client *Client) AppendUserAgent(userAgent *string)
- func (client *Client) BuildHaQueryAggregateClauseStr(Clause []*HaQueryAggregateClause) (_result *string, _err error)
- func (client *Client) BuildHaQueryDistinctClauseStr(Clause []*HaQueryDistinctClause) (_result *string, _err error)
- func (client *Client) BuildHaQuerySortClauseStr(Clause []*HaQuerySortClause) (_result *string)
- func (client *Client) BuildHaQueryconfigClauseStr(Clause *HaQueryconfigClause) (_result *string, _err error)
- func (client *Client) BuildHaSearchQuery(haquery *HaQuery) (_result *string, _err error)
- func (client *Client) BuildSQLSearchQuery(sqlquery *SQLQuery) (_result *string, _err error)
- func (client *Client) BuildSearcKvPairClauseStr(kvPair map[string]*string) (_result *string)
- func (client *Client) GetRealmSignStr(accessUserName *string, accessPassWord *string) (_result *string)
- func (client *Client) GetUserAgent() (_result *string)
- func (client *Client) Init(config *Config) (_err error)
- func (client *Client) PushDocumentEx(dataSourceName *string, request *PushDocumentsRequestModel, ...) (_result *PushDocumentsResponseModel, _err error)
- func (client *Client) PushDocuments(dataSourceName *string, keyField *string, request *PushDocumentsRequestModel) (_result *PushDocumentsResponseModel, _err error)
- func (client *Client) PushDocumentsWithOptions(dataSourceName *string, keyField *string, request *PushDocumentsRequestModel, ...) (_result *PushDocumentsResponseModel, _err error)
- func (client *Client) Search(request *SearchRequestModel) (_result *SearchResponseModel, _err error)
- func (client *Client) SearchEx(request *SearchRequestModel, runtime *util.RuntimeOptions) (_result *SearchResponseModel, _err error)
- func (client *Client) SearchWithOptions(request *SearchRequestModel, runtime *util.RuntimeOptions) (_result *SearchResponseModel, _err error)
- func (client *Client) SetUserAgent(userAgent *string)
- type Config
- func (s Config) GoString() string
- func (s *Config) SetAccessPassWord(v string) *Config
- func (s *Config) SetAccessUserName(v string) *Config
- func (s *Config) SetEndpoint(v string) *Config
- func (s *Config) SetInstanceId(v string) *Config
- func (s *Config) SetProtocol(v string) *Config
- func (s *Config) SetUserAgent(v string) *Config
- func (s Config) String() string
- type HaQuery
- func (s HaQuery) GoString() string
- func (s *HaQuery) SetAggregate(v []*HaQueryAggregateClause) *HaQuery
- func (s *HaQuery) SetCluster(v string) *HaQuery
- func (s *HaQuery) SetConfig(v *HaQueryconfigClause) *HaQuery
- func (s *HaQuery) SetCustomQuery(v map[string]*string) *HaQuery
- func (s *HaQuery) SetDistinct(v []*HaQueryDistinctClause) *HaQuery
- func (s *HaQuery) SetFilter(v string) *HaQuery
- func (s *HaQuery) SetKvpairs(v map[string]*string) *HaQuery
- func (s *HaQuery) SetQuery(v string) *HaQuery
- func (s *HaQuery) SetSort(v []*HaQuerySortClause) *HaQuery
- func (s HaQuery) String() string
- type HaQueryAggregateClause
- func (s HaQueryAggregateClause) GoString() string
- func (s *HaQueryAggregateClause) SetAggFilter(v string) *HaQueryAggregateClause
- func (s *HaQueryAggregateClause) SetAggFun(v string) *HaQueryAggregateClause
- func (s *HaQueryAggregateClause) SetAggSamplerStep(v string) *HaQueryAggregateClause
- func (s *HaQueryAggregateClause) SetAggSamplerThresHold(v string) *HaQueryAggregateClause
- func (s *HaQueryAggregateClause) SetGroupKey(v string) *HaQueryAggregateClause
- func (s *HaQueryAggregateClause) SetMaxGroup(v string) *HaQueryAggregateClause
- func (s *HaQueryAggregateClause) SetRange(v string) *HaQueryAggregateClause
- func (s HaQueryAggregateClause) String() string
- type HaQueryDistinctClause
- func (s HaQueryDistinctClause) GoString() string
- func (s *HaQueryDistinctClause) SetDistCount(v string) *HaQueryDistinctClause
- func (s *HaQueryDistinctClause) SetDistFilter(v string) *HaQueryDistinctClause
- func (s *HaQueryDistinctClause) SetDistKey(v string) *HaQueryDistinctClause
- func (s *HaQueryDistinctClause) SetDistTimes(v string) *HaQueryDistinctClause
- func (s *HaQueryDistinctClause) SetGrade(v string) *HaQueryDistinctClause
- func (s *HaQueryDistinctClause) SetReserved(v string) *HaQueryDistinctClause
- func (s *HaQueryDistinctClause) SetUpdateTotalHit(v string) *HaQueryDistinctClause
- func (s HaQueryDistinctClause) String() string
- type HaQuerySortClause
- type HaQueryconfigClause
- func (s HaQueryconfigClause) GoString() string
- func (s *HaQueryconfigClause) SetCustomConfig(v map[string]*string) *HaQueryconfigClause
- func (s *HaQueryconfigClause) SetFormat(v string) *HaQueryconfigClause
- func (s *HaQueryconfigClause) SetHit(v string) *HaQueryconfigClause
- func (s *HaQueryconfigClause) SetStart(v string) *HaQueryconfigClause
- func (s HaQueryconfigClause) String() string
- type PushDocumentsRequestModel
- type PushDocumentsResponseModel
- type SQLQuery
- type SearchQuery
- type SearchRequestModel
- type SearchResponseModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Endpoint *string InstanceId *string Protocol *string UserAgent *string Credential *string Domainsuffix *string }
func (*Client) BuildHaQueryAggregateClauseStr ¶
func (client *Client) BuildHaQueryAggregateClauseStr(Clause []*HaQueryAggregateClause) (_result *string, _err error)
func (*Client) BuildHaQueryDistinctClauseStr ¶
func (client *Client) BuildHaQueryDistinctClauseStr(Clause []*HaQueryDistinctClause) (_result *string, _err error)
func (*Client) BuildHaQuerySortClauseStr ¶
func (client *Client) BuildHaQuerySortClauseStr(Clause []*HaQuerySortClause) (_result *string)
func (*Client) BuildHaQueryconfigClauseStr ¶
func (client *Client) BuildHaQueryconfigClauseStr(Clause *HaQueryconfigClause) (_result *string, _err error)
func (*Client) BuildHaSearchQuery ¶
func (*Client) BuildSQLSearchQuery ¶
func (*Client) BuildSearcKvPairClauseStr ¶
func (*Client) GetRealmSignStr ¶
func (client *Client) GetRealmSignStr(accessUserName *string, accessPassWord *string) (_result *string)
*
- 计算用户请求识别特征, 遵循 Basic Auth 生成规范.
func (*Client) PushDocumentEx ¶
func (client *Client) PushDocumentEx(dataSourceName *string, request *PushDocumentsRequestModel, runtime *util.RuntimeOptions) (_result *PushDocumentsResponseModel, _err error)
*
- 支持新增、更新、删除 等操作,以及对应批量操作
func (*Client) PushDocuments ¶
func (client *Client) PushDocuments(dataSourceName *string, keyField *string, request *PushDocumentsRequestModel) (_result *PushDocumentsResponseModel, _err error)
*
- 支持新增、更新、删除 等操作,以及对应批量操作
func (*Client) PushDocumentsWithOptions ¶
func (client *Client) PushDocumentsWithOptions(dataSourceName *string, keyField *string, request *PushDocumentsRequestModel, runtime *util.RuntimeOptions) (_result *PushDocumentsResponseModel, _err error)
*
- 支持新增、更新、删除 等操作,以及对应批量操作,及传入运行时参数.
func (*Client) Search ¶
func (client *Client) Search(request *SearchRequestModel) (_result *SearchResponseModel, _err error)
*
- 系统提供了丰富的搜索语法以满足用户各种场景下的搜索需求。
func (*Client) SearchEx ¶
func (client *Client) SearchEx(request *SearchRequestModel, runtime *util.RuntimeOptions) (_result *SearchResponseModel, _err error)
*
- 系统提供了丰富的搜索语法以满足用户各种场景下的搜索需求。
func (*Client) SearchWithOptions ¶
func (client *Client) SearchWithOptions(request *SearchRequestModel, runtime *util.RuntimeOptions) (_result *SearchResponseModel, _err error)
*
- 系统提供了丰富的搜索语法以满足用户各种场景下的搜索需求,及传入运行时参数.
type Config ¶
type Config struct { Endpoint *string `json:"endpoint,omitempty" xml:"endpoint,omitempty"` InstanceId *string `json:"instanceId,omitempty" xml:"instanceId,omitempty"` Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty"` AccessUserName *string `json:"accessUserName,omitempty" xml:"accessUserName,omitempty"` AccessPassWord *string `json:"accessPassWord,omitempty" xml:"accessPassWord,omitempty"` UserAgent *string `json:"userAgent,omitempty" xml:"userAgent,omitempty"` }
func (*Config) SetAccessPassWord ¶
func (*Config) SetAccessUserName ¶
func (*Config) SetEndpoint ¶
func (*Config) SetInstanceId ¶
func (*Config) SetProtocol ¶
func (*Config) SetUserAgent ¶
type HaQuery ¶
type HaQuery struct { // 搜索主体,不能为空.并且可以指定多个查询条件及其之间的关系. Query *string `json:"query,omitempty" xml:"query,omitempty" require:"true"` // cluster部分用于指定要查询的集群的名字。它不仅可以同时指定多个集群,还可以指定到集群中的哪些partition获取结果。 Cluster *string `json:"cluster,omitempty" xml:"cluster,omitempty"` // config部分可以指定查询结果的起始位置、返回结果的数量、展现结果的格式、参与精排表达式文档个数等。 Config *HaQueryconfigClause `json:"config,omitempty" xml:"config,omitempty" require:"true"` // 过滤功能支持用户根据查询条件,筛选出用户感兴趣的文档。会在通过query子句查找到的文档进行进一步的过滤,以返回最终所需结果。 Filter *string `json:"filter,omitempty" xml:"filter,omitempty"` // 为便于通过查询语句传递信息给具体的特征函数,用户可以在kvpairs子句中对排序表达式中的可变部分进行参数定义。 Kvpairs map[string]*string `json:"kvpairs,omitempty" xml:"kvpairs,omitempty"` // 用户可以通过查询语句控制结果的排序方式,包括指定排序的字段和升降序。field为要排序的字段,+为按字段值升序排序,-为降序排序 Sort []*HaQuerySortClause `json:"sort,omitempty" xml:"sort,omitempty" type:"Repeated"` // 一个关键词查询后可能会找到数以万计的文档,用户不太可能浏览所有的文档来获取自己需要的信息,有些情况下用户感兴趣的可能是一些统计的信息。 Aggregate []*HaQueryAggregateClause `json:"aggregate,omitempty" xml:"aggregate,omitempty" type:"Repeated"` // 打散子句可以在一定程度上保证展示结果的多样性,以提升用户体验。如一次查询可以查出很多的文档,但是如果某个用户的多个文档分值都比较高,则都排在了前面,导致一页中所展示的结果几乎都属于同一用户,这样既不利于结果展示也不利于用户体验。对此,打散子句可以对每个用户的文档进行抽取,使得每个用户都有展示文档的机会。 Distinct []*HaQueryDistinctClause `json:"distinct,omitempty" xml:"distinct,omitempty" type:"Repeated"` // 扩展 配置参数 CustomQuery map[string]*string `json:"customConfig,omitempty" xml:"customConfig,omitempty"` }
func (*HaQuery) SetAggregate ¶
func (s *HaQuery) SetAggregate(v []*HaQueryAggregateClause) *HaQuery
func (*HaQuery) SetCluster ¶
func (*HaQuery) SetConfig ¶
func (s *HaQuery) SetConfig(v *HaQueryconfigClause) *HaQuery
func (*HaQuery) SetDistinct ¶
func (s *HaQuery) SetDistinct(v []*HaQueryDistinctClause) *HaQuery
func (*HaQuery) SetSort ¶
func (s *HaQuery) SetSort(v []*HaQuerySortClause) *HaQuery
type HaQueryAggregateClause ¶
type HaQueryAggregateClause struct { // field为要进行统计的字段名,必须配置属性字段 GroupKey *string `json:"group_key,omitempty" xml:"group_key,omitempty" require:"true"` // func可以为count()、sum(id)、max(id)、min(id)四种系统函数,含义分别为:文档个数、对id字段求和、取id字段最大值、取id字段最小值;支持同时进行多个函数的统计,中间用英文井号(#)分隔;sum、max、min的内容支持基本的算术运算 AggFun *string `json:"agg_fun,omitempty" xml:"agg_fun,omitempty" require:"true"` // 表示分段统计,可用于分布统计,只支持单个range参数。 Range *string `json:"range,omitempty" xml:"range,omitempty"` // 最大返回组数 MaxGroup *string `json:"max_group,omitempty" xml:"max_group,omitempty"` // 表示仅统计满足特定条件的文档 AggFilter *string `json:"agg_filter,omitempty" xml:"agg_filter,omitempty"` // ,抽样统计的阈值。表示该值之前的文档会依次统计,该值之后的文档会进行抽样统计; AggSamplerThresHold *string `json:"agg_sampler_threshold,omitempty" xml:"agg_sampler_threshold,omitempty"` // 抽样统计的步长,表示从agg_sampler_threshold后的文档将间隔agg_sampler_step个文档统计一次。对于sum和count类型的统计会把阈值后的抽样统计结果最后乘以步长进行估算,估算的结果再加上阈值前的统计结果就是最后的统计结果。 AggSamplerStep *string `json:"agg_sampler_step,omitempty" xml:"agg_sampler_step,omitempty"` }
func (HaQueryAggregateClause) GoString ¶
func (s HaQueryAggregateClause) GoString() string
func (*HaQueryAggregateClause) SetAggFilter ¶
func (s *HaQueryAggregateClause) SetAggFilter(v string) *HaQueryAggregateClause
func (*HaQueryAggregateClause) SetAggFun ¶
func (s *HaQueryAggregateClause) SetAggFun(v string) *HaQueryAggregateClause
func (*HaQueryAggregateClause) SetAggSamplerStep ¶
func (s *HaQueryAggregateClause) SetAggSamplerStep(v string) *HaQueryAggregateClause
func (*HaQueryAggregateClause) SetAggSamplerThresHold ¶
func (s *HaQueryAggregateClause) SetAggSamplerThresHold(v string) *HaQueryAggregateClause
func (*HaQueryAggregateClause) SetGroupKey ¶
func (s *HaQueryAggregateClause) SetGroupKey(v string) *HaQueryAggregateClause
func (*HaQueryAggregateClause) SetMaxGroup ¶
func (s *HaQueryAggregateClause) SetMaxGroup(v string) *HaQueryAggregateClause
func (*HaQueryAggregateClause) SetRange ¶
func (s *HaQueryAggregateClause) SetRange(v string) *HaQueryAggregateClause
func (HaQueryAggregateClause) String ¶
func (s HaQueryAggregateClause) String() string
type HaQueryDistinctClause ¶
type HaQueryDistinctClause struct { // 要打散的字段 DistKey *string `json:"dist_key,omitempty" xml:"dist_key,omitempty" require:"true"` // 一轮抽取的文档数 DistCount *string `json:"dist_count,omitempty" xml:"dist_count,omitempty"` // 抽取的轮数 DistTimes *string `json:"dist_times,omitempty" xml:"dist_times,omitempty"` // 是否保留抽取之后剩余的文档。如果为false,为不保留,则搜索结果的total(总匹配结果数)会不准确。 Reserved *string `json:"reserved,omitempty" xml:"reserved,omitempty"` // 过滤条件,被过滤的doc不参与distinct,只在后面的排序中,这些被过滤的doc将和被distinct出来的第一组doc一起参与排序。默认是全部参与distinct。 DistFilter *string `json:"dist_filter,omitempty" xml:"dist_filter,omitempty"` // 当reserved为false时,设置update_total_hit为true,则最终total_hit会减去被distinct丢弃的数目(不一定准确),为false则不减。 UpdateTotalHit *string `json:"update_total_hit,omitempty" xml:"update_total_hit,omitempty"` // 指定档位划分阈值,所有的文档将根据档位划分阈值划分成若干档,每个档位中各自根据distinct参数做distinct,可以不指定该参数,默认是所有文档都在同一档。档位的划分按照文档排序时第一维的排序依据的分数进行划分,两个档位阈值之间用 “|” 分开,档位的个数没有限制。例如:1、grade:3.0 :表示根据第一维排序依据的分数分成两档,(< 3.0)的是第一档,(>= 3.0) 的是第二档;2、grade:3.0|5.0 :表示分成三档,(< 3.0)是第一档,(>= 3.0,< 5.0)是第二档,(>= 5.0)是第三档。档位的先后顺序和第一维排序依据的顺序一致,即如果第一维排序依据是降序,则档位也是降序,反之亦然。 Grade *string `json:"grade,omitempty" xml:"grade,omitempty"` }
func (HaQueryDistinctClause) GoString ¶
func (s HaQueryDistinctClause) GoString() string
func (*HaQueryDistinctClause) SetDistCount ¶
func (s *HaQueryDistinctClause) SetDistCount(v string) *HaQueryDistinctClause
func (*HaQueryDistinctClause) SetDistFilter ¶
func (s *HaQueryDistinctClause) SetDistFilter(v string) *HaQueryDistinctClause
func (*HaQueryDistinctClause) SetDistKey ¶
func (s *HaQueryDistinctClause) SetDistKey(v string) *HaQueryDistinctClause
func (*HaQueryDistinctClause) SetDistTimes ¶
func (s *HaQueryDistinctClause) SetDistTimes(v string) *HaQueryDistinctClause
func (*HaQueryDistinctClause) SetGrade ¶
func (s *HaQueryDistinctClause) SetGrade(v string) *HaQueryDistinctClause
func (*HaQueryDistinctClause) SetReserved ¶
func (s *HaQueryDistinctClause) SetReserved(v string) *HaQueryDistinctClause
func (*HaQueryDistinctClause) SetUpdateTotalHit ¶
func (s *HaQueryDistinctClause) SetUpdateTotalHit(v string) *HaQueryDistinctClause
func (HaQueryDistinctClause) String ¶
func (s HaQueryDistinctClause) String() string
type HaQuerySortClause ¶
type HaQuerySortClause struct { // field为要进行统计的字段名,必须配置属性字段 SortKey *string `json:"sortKey,omitempty" xml:"sortKey,omitempty" require:"true"` // +为按字段值升序排序,-为降序排序 SortOrder *string `json:"sortOrder,omitempty" xml:"sortOrder,omitempty" require:"true"` }
func (HaQuerySortClause) GoString ¶
func (s HaQuerySortClause) GoString() string
func (*HaQuerySortClause) SetSortKey ¶
func (s *HaQuerySortClause) SetSortKey(v string) *HaQuerySortClause
func (*HaQuerySortClause) SetSortOrder ¶
func (s *HaQuerySortClause) SetSortOrder(v string) *HaQuerySortClause
func (HaQuerySortClause) String ¶
func (s HaQuerySortClause) String() string
type HaQueryconfigClause ¶
type HaQueryconfigClause struct { // 从结果集中第 start_offset 开始返回 document Start *string `json:"start,omitempty" xml:"start,omitempty" require:"true"` // 返回文档的最大数量 Hit *string `json:"hit,omitempty" xml:"hit,omitempty" require:"true"` // 指定用户返回数据格式. 支持 xml 和 json 类型数据返回 Format *string `json:"format,omitempty" xml:"format,omitempty" require:"true"` // 扩展 配置参数 CustomConfig map[string]*string `json:"customConfig,omitempty" xml:"customConfig,omitempty"` }
func (HaQueryconfigClause) GoString ¶
func (s HaQueryconfigClause) GoString() string
func (*HaQueryconfigClause) SetCustomConfig ¶
func (s *HaQueryconfigClause) SetCustomConfig(v map[string]*string) *HaQueryconfigClause
func (*HaQueryconfigClause) SetFormat ¶
func (s *HaQueryconfigClause) SetFormat(v string) *HaQueryconfigClause
func (*HaQueryconfigClause) SetHit ¶
func (s *HaQueryconfigClause) SetHit(v string) *HaQueryconfigClause
func (*HaQueryconfigClause) SetStart ¶
func (s *HaQueryconfigClause) SetStart(v string) *HaQueryconfigClause
func (HaQueryconfigClause) String ¶
func (s HaQueryconfigClause) String() string
type PushDocumentsRequestModel ¶
type PushDocumentsRequestModel struct { // headers Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` // body Body []map[string]interface{} `json:"body,omitempty" xml:"body,omitempty" require:"true" type:"Repeated"` }
func (PushDocumentsRequestModel) GoString ¶
func (s PushDocumentsRequestModel) GoString() string
func (*PushDocumentsRequestModel) SetBody ¶
func (s *PushDocumentsRequestModel) SetBody(v []map[string]interface{}) *PushDocumentsRequestModel
func (*PushDocumentsRequestModel) SetHeaders ¶
func (s *PushDocumentsRequestModel) SetHeaders(v map[string]*string) *PushDocumentsRequestModel
func (PushDocumentsRequestModel) String ¶
func (s PushDocumentsRequestModel) String() string
type PushDocumentsResponseModel ¶
type PushDocumentsResponseModel struct { // headers Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` // body Body *string `json:"body,omitempty" xml:"body,omitempty" require:"true"` }
func (PushDocumentsResponseModel) GoString ¶
func (s PushDocumentsResponseModel) GoString() string
func (*PushDocumentsResponseModel) SetBody ¶
func (s *PushDocumentsResponseModel) SetBody(v string) *PushDocumentsResponseModel
func (*PushDocumentsResponseModel) SetHeaders ¶
func (s *PushDocumentsResponseModel) SetHeaders(v map[string]*string) *PushDocumentsResponseModel
func (PushDocumentsResponseModel) String ¶
func (s PushDocumentsResponseModel) String() string
type SQLQuery ¶
type SearchQuery ¶
type SearchQuery struct { // 适配于 Ha3 类型 query. 参数支持子句关键字请参照文档 Query *string `json:"query,omitempty" xml:"query,omitempty"` // 适配于 SQL 类型 query. 参数支持子句关键字请参照文档. Sql *string `json:"sql,omitempty" xml:"sql,omitempty"` }
func (SearchQuery) GoString ¶
func (s SearchQuery) GoString() string
func (*SearchQuery) SetQuery ¶
func (s *SearchQuery) SetQuery(v string) *SearchQuery
func (*SearchQuery) SetSql ¶
func (s *SearchQuery) SetSql(v string) *SearchQuery
func (SearchQuery) String ¶
func (s SearchQuery) String() string
type SearchRequestModel ¶
type SearchRequestModel struct { // headers Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` // query Query *SearchQuery `json:"query,omitempty" xml:"query,omitempty" require:"true"` }
func (SearchRequestModel) GoString ¶
func (s SearchRequestModel) GoString() string
func (*SearchRequestModel) SetHeaders ¶
func (s *SearchRequestModel) SetHeaders(v map[string]*string) *SearchRequestModel
func (*SearchRequestModel) SetQuery ¶
func (s *SearchRequestModel) SetQuery(v *SearchQuery) *SearchRequestModel
func (SearchRequestModel) String ¶
func (s SearchRequestModel) String() string
type SearchResponseModel ¶
type SearchResponseModel struct { // headers Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` // body Body *string `json:"body,omitempty" xml:"body,omitempty" require:"true"` }
func (SearchResponseModel) GoString ¶
func (s SearchResponseModel) GoString() string
func (*SearchResponseModel) SetBody ¶
func (s *SearchResponseModel) SetBody(v string) *SearchResponseModel
func (*SearchResponseModel) SetHeaders ¶
func (s *SearchResponseModel) SetHeaders(v map[string]*string) *SearchResponseModel
func (SearchResponseModel) String ¶
func (s SearchResponseModel) String() string
Click to show internal directories.
Click to hide internal directories.