opensearch

package
v0.0.0-...-ab98a91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Internet   = ""
	Intranet   = "intranet."
	VPC        = "vpc."
	APIVersion = "v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(networkType string, region common.Region, accessKeyId, accessKeySecret string) *Client

func (*Client) GetStatus

func (this *Client) GetStatus(appName string, resp interface{}) error

查看应用信息

func (*Client) Push

func (this *Client) Push(appName string, args PushArgs, resp interface{}) error

上传文档 支持新增、更新、删除的批量操作

func (*Client) Search

func (this *Client) Search(args SearchArgs, resp interface{}) error

搜索 系统提供了丰富的搜索语法以满足用户各种场景下的搜索需求

type OpenSearchArgs

type OpenSearchArgs struct {
	Action string `ArgName:"action"`
}

OpenSearch的API比较奇怪,action不在公共参数里面

type PushArgs

type PushArgs struct {
	OpenSearchArgs        // 这个参数不用填
	Table_name     string `ArgName:"table_name"` //要上传数据的表名
	Items          string `ArgName:"items"`      //规定JSON格式
}

type SearchArgs

type SearchArgs struct {
	//搜索主体
	Query string `ArgName:"query"`
	//要查询的应用名
	Index_name string `ArgName:"index_name"`
	//[可以通过此参数获取本次查询需要的字段内容]
	Fetch_fields string `ArgName:"fetch_fields"`
	//[指定要使用的查询分析规则]
	Qp string `ArgName:"qp"`
	//[关闭已生效的查询分析功能]
	Disable string `ArgName:"disable"`
	//[设置粗排表达式名字]
	First_formula_name string `ArgName:"first_formula_name"`
	//[设置精排表达式名字]
	Formula_name string `ArgName:"formula_name"`
	//[动态摘要的配置]
	Summary string `ArgName:"summary"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL