validatequery

package
v8.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Allows a user to validate a potentially expensive query without executing it.

Index

Constants

This section is empty.

Variables

View Source
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 NewValidateQuery

type NewValidateQuery func() *ValidateQuery

NewValidateQuery type alias for index.

func NewValidateQueryFunc

func NewValidateQueryFunc(tp elastictransport.Interface) NewValidateQuery

NewValidateQueryFunc returns a new instance of ValidateQuery with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type RequestBuilder

type RequestBuilder struct {
	// contains filtered or unexported fields
}

RequestBuilder is the builder API for the validatequery.Request

func NewRequestBuilder

func NewRequestBuilder() *RequestBuilder

NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder

func (*RequestBuilder) Build

func (rb *RequestBuilder) Build() *Request

Build finalize the chain and returns the Request struct.

func (*RequestBuilder) FromJSON

func (rb *RequestBuilder) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*RequestBuilder) Query

type ValidateQuery

type ValidateQuery struct {
	// contains filtered or unexported fields
}

func New

Allows a user to validate a potentially expensive query without executing it.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html

func (*ValidateQuery) AllShards

func (r *ValidateQuery) AllShards(b bool) *ValidateQuery

AllShards Execute validation on all shards instead of one random shard per index API name: all_shards

func (*ValidateQuery) AllowNoIndices

func (r *ValidateQuery) AllowNoIndices(b bool) *ValidateQuery

AllowNoIndices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) API name: allow_no_indices

func (*ValidateQuery) AnalyzeWildcard

func (r *ValidateQuery) AnalyzeWildcard(b bool) *ValidateQuery

AnalyzeWildcard Specify whether wildcard and prefix queries should be analyzed (default: false) API name: analyze_wildcard

func (*ValidateQuery) Analyzer

func (r *ValidateQuery) Analyzer(value string) *ValidateQuery

Analyzer The analyzer to use for the query string API name: analyzer

func (*ValidateQuery) DefaultOperator

func (r *ValidateQuery) DefaultOperator(enum operator.Operator) *ValidateQuery

DefaultOperator The default operator for query string query (AND or OR) API name: default_operator

func (*ValidateQuery) Df

func (r *ValidateQuery) Df(value string) *ValidateQuery

Df The field to use as default where no field prefix is given in the query string API name: df

func (ValidateQuery) Do

Do runs the http.Request through the provided transport.

func (*ValidateQuery) ExpandWildcards

func (r *ValidateQuery) ExpandWildcards(value string) *ValidateQuery

ExpandWildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. API name: expand_wildcards

func (*ValidateQuery) Explain

func (r *ValidateQuery) Explain(b bool) *ValidateQuery

Explain Return detailed information about the error API name: explain

func (*ValidateQuery) Header

func (r *ValidateQuery) Header(key, value string) *ValidateQuery

Header set a key, value pair in the ValidateQuery headers map.

func (*ValidateQuery) HttpRequest

func (r *ValidateQuery) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*ValidateQuery) IgnoreUnavailable

func (r *ValidateQuery) IgnoreUnavailable(b bool) *ValidateQuery

IgnoreUnavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) API name: ignore_unavailable

func (*ValidateQuery) Index

func (r *ValidateQuery) Index(v string) *ValidateQuery

Index A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices API Name: index

func (*ValidateQuery) Lenient

func (r *ValidateQuery) Lenient(b bool) *ValidateQuery

Lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored API name: lenient

func (*ValidateQuery) Q

func (r *ValidateQuery) Q(value string) *ValidateQuery

Q Query in the Lucene query string syntax API name: q

func (*ValidateQuery) Raw

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*ValidateQuery) Request

func (r *ValidateQuery) Request(req *Request) *ValidateQuery

Request allows to set the request property with the appropriate payload.

func (*ValidateQuery) Rewrite

func (r *ValidateQuery) Rewrite(b bool) *ValidateQuery

Rewrite Provide a more detailed explanation showing the actual Lucene query that will be executed. API name: rewrite

Jump to

Keyboard shortcuts

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