Documentation ¶
Overview ¶
Performs the analysis process on a text and return the tokens breakdown of the text.
Index ¶
- Variables
- type Analyze
- func (r *Analyze) Analyzer(analyzer string) *Analyze
- func (r *Analyze) Attributes(attributes ...string) *Analyze
- func (r *Analyze) CharFilter(charfilters ...types.CharFilter) *Analyze
- func (r Analyze) Do(ctx context.Context) (*Response, error)
- func (r *Analyze) Explain(explain bool) *Analyze
- func (r *Analyze) Field(field string) *Analyze
- func (r *Analyze) Filter(filters ...types.TokenFilter) *Analyze
- func (r *Analyze) Header(key, value string) *Analyze
- func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Analyze) Index(index string) *Analyze
- func (r *Analyze) Normalizer(normalizer string) *Analyze
- func (r Analyze) Perform(ctx context.Context) (*http.Response, error)
- func (r *Analyze) Raw(raw io.Reader) *Analyze
- func (r *Analyze) Request(req *Request) *Analyze
- func (r *Analyze) Text(texttoanalyzes ...string) *Analyze
- func (r *Analyze) Tokenizer(tokenizer types.Tokenizer) *Analyze
- type NewAnalyze
- 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 Analyze ¶
type Analyze struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Analyze
Performs the analysis process on a text and return the tokens breakdown of the text.
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html
func (*Analyze) Attributes ¶ added in v8.9.0
API name: attributes
func (*Analyze) CharFilter ¶ added in v8.9.0
func (r *Analyze) CharFilter(charfilters ...types.CharFilter) *Analyze
API name: char_filter
func (Analyze) Do ¶
Do runs the request through the transport, handle the response and returns a analyze.Response
func (*Analyze) Filter ¶ added in v8.9.0
func (r *Analyze) Filter(filters ...types.TokenFilter) *Analyze
API name: filter
func (*Analyze) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Analyze) Normalizer ¶ added in v8.9.0
API name: normalizer
func (Analyze) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Analyze) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
type NewAnalyze ¶
type NewAnalyze func() *Analyze
NewAnalyze type alias for index.
func NewAnalyzeFunc ¶
func NewAnalyzeFunc(tp elastictransport.Interface) NewAnalyze
NewAnalyzeFunc returns a new instance of Analyze with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { Analyzer *string `json:"analyzer,omitempty"` Attributes []string `json:"attributes,omitempty"` CharFilter []types.CharFilter `json:"char_filter,omitempty"` Explain *bool `json:"explain,omitempty"` Field *string `json:"field,omitempty"` Filter []types.TokenFilter `json:"filter,omitempty"` Normalizer *string `json:"normalizer,omitempty"` Text []string `json:"text,omitempty"` Tokenizer types.Tokenizer `json:"tokenizer,omitempty"` }
Request holds the request body struct for the package analyze
type Response ¶ added in v8.7.0
type Response struct { Detail *types.AnalyzeDetail `json:"detail,omitempty"` Tokens []types.AnalyzeToken `json:"tokens,omitempty"` }