Documentation
¶
Overview ¶
Render a search application query. Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified. If a parameter used in the search template is not specified in `params`, the parameter's default value will be used. The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API.
You must have `read` privileges on the backing alias of the search application.
Index ¶
- Variables
- type NewRenderQuery
- type RenderQuery
- func (r *RenderQuery) AddParam(key string, value json.RawMessage) *RenderQuery
- func (r RenderQuery) Do(providedCtx context.Context) (*Response, error)
- func (r *RenderQuery) ErrorTrace(errortrace bool) *RenderQuery
- func (r *RenderQuery) FilterPath(filterpaths ...string) *RenderQuery
- func (r *RenderQuery) Header(key, value string) *RenderQuery
- func (r *RenderQuery) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *RenderQuery) Human(human bool) *RenderQuery
- func (r *RenderQuery) Params(params map[string]json.RawMessage) *RenderQuery
- func (r RenderQuery) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *RenderQuery) Pretty(pretty bool) *RenderQuery
- func (r *RenderQuery) Raw(raw io.Reader) *RenderQuery
- func (r *RenderQuery) Request(req *Request) *RenderQuery
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewRenderQuery ¶
type NewRenderQuery func(name string) *RenderQuery
NewRenderQuery type alias for index.
func NewRenderQueryFunc ¶
func NewRenderQueryFunc(tp elastictransport.Interface) NewRenderQuery
NewRenderQueryFunc returns a new instance of RenderQuery with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type RenderQuery ¶
type RenderQuery struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *RenderQuery
Render a search application query. Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified. If a parameter used in the search template is not specified in `params`, the parameter's default value will be used. The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API.
You must have `read` privileges on the backing alias of the search application.
func (*RenderQuery) AddParam ¶
func (r *RenderQuery) AddParam(key string, value json.RawMessage) *RenderQuery
func (RenderQuery) Do ¶
func (r RenderQuery) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a renderquery.Response
func (*RenderQuery) ErrorTrace ¶
func (r *RenderQuery) ErrorTrace(errortrace bool) *RenderQuery
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*RenderQuery) FilterPath ¶
func (r *RenderQuery) FilterPath(filterpaths ...string) *RenderQuery
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*RenderQuery) Header ¶
func (r *RenderQuery) Header(key, value string) *RenderQuery
Header set a key, value pair in the RenderQuery headers map.
func (*RenderQuery) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*RenderQuery) Human ¶
func (r *RenderQuery) Human(human bool) *RenderQuery
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (*RenderQuery) Params ¶
func (r *RenderQuery) Params(params map[string]json.RawMessage) *RenderQuery
API name: params
func (RenderQuery) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*RenderQuery) Pretty ¶
func (r *RenderQuery) Pretty(pretty bool) *RenderQuery
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*RenderQuery) Raw ¶
func (r *RenderQuery) Raw(raw io.Reader) *RenderQuery
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*RenderQuery) Request ¶
func (r *RenderQuery) Request(req *Request) *RenderQuery
Request allows to set the request property with the appropriate payload.
type Request ¶
type Request struct {
Params map[string]json.RawMessage `json:"params,omitempty"`
}
Request holds the request body struct for the package renderquery