Documentation ¶
Overview ¶
Performs the analysis process on a text and return the tokens breakdown of the text.
Index ¶
- Variables
- type Analyze
- func (r Analyze) Do(ctx context.Context) (*Response, error)
- func (r *Analyze) Header(key, value string) *Analyze
- func (r *Analyze) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Analyze) Index(v 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
- 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) Do ¶
Do runs the request through the transport, handle the response and returns a analyze.Response
func (*Analyze) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (Analyze) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
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"` }