Documentation ¶
Overview ¶
Returns information and statistics about terms in the fields of a particular document.
Index ¶
- Variables
- type NewTermvectors
- type Request
- type Response
- type Termvectors
- func (r Termvectors) Do(providedCtx context.Context) (*Response, error)
- func (r *Termvectors) Doc(doc interface{}) *Termvectors
- func (r *Termvectors) FieldStatistics(fieldstatistics bool) *Termvectors
- func (r *Termvectors) Fields(fields ...string) *Termvectors
- func (r *Termvectors) Filter(filter *types.TermVectorsFilter) *Termvectors
- func (r *Termvectors) Header(key, value string) *Termvectors
- func (r *Termvectors) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Termvectors) Id(id string) *Termvectors
- func (r *Termvectors) Offsets(offsets bool) *Termvectors
- func (r *Termvectors) Payloads(payloads bool) *Termvectors
- func (r *Termvectors) PerFieldAnalyzer(perfieldanalyzer map[string]string) *Termvectors
- func (r Termvectors) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Termvectors) Positions(positions bool) *Termvectors
- func (r *Termvectors) Preference(preference string) *Termvectors
- func (r *Termvectors) Raw(raw io.Reader) *Termvectors
- func (r *Termvectors) Realtime(realtime bool) *Termvectors
- func (r *Termvectors) Request(req *Request) *Termvectors
- func (r *Termvectors) Routing(routing string) *Termvectors
- func (r *Termvectors) TermStatistics(termstatistics bool) *Termvectors
- func (r *Termvectors) Version(versionnumber string) *Termvectors
- func (r *Termvectors) VersionType(versiontype versiontype.VersionType) *Termvectors
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 NewTermvectors ¶
type NewTermvectors func(index string) *Termvectors
NewTermvectors type alias for index.
func NewTermvectorsFunc ¶
func NewTermvectorsFunc(tp elastictransport.Interface) NewTermvectors
NewTermvectorsFunc returns a new instance of Termvectors 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 { // Doc An artificial document (a document not present in the index) for which you // want to retrieve term vectors. Doc json.RawMessage `json:"doc,omitempty"` // Filter Filter terms based on their tf-idf scores. Filter *types.TermVectorsFilter `json:"filter,omitempty"` // PerFieldAnalyzer Overrides the default per-field analyzer. PerFieldAnalyzer map[string]string `json:"per_field_analyzer,omitempty"` }
Request holds the request body struct for the package termvectors
type Response ¶ added in v8.7.0
type Response struct { Found bool `json:"found"` Id_ string `json:"_id"` Index_ string `json:"_index"` TermVectors map[string]types.TermVector `json:"term_vectors,omitempty"` Took int64 `json:"took"` Version_ int64 `json:"_version"` }
Response holds the response body struct for the package termvectors
type Termvectors ¶
type Termvectors struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Termvectors
Returns information and statistics about terms in the fields of a particular document.
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html
func (Termvectors) Do ¶
func (r Termvectors) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a termvectors.Response
func (*Termvectors) Doc ¶ added in v8.9.0
func (r *Termvectors) Doc(doc interface{}) *Termvectors
Doc An artificial document (a document not present in the index) for which you want to retrieve term vectors. API name: doc
doc should be a json.RawMessage or a structure if a structure is provided, the client will defer a json serialization prior to sending the payload to Elasticsearch.
func (*Termvectors) FieldStatistics ¶
func (r *Termvectors) FieldStatistics(fieldstatistics bool) *Termvectors
FieldStatistics If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. API name: field_statistics
func (*Termvectors) Fields ¶
func (r *Termvectors) Fields(fields ...string) *Termvectors
Fields Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. API name: fields
func (*Termvectors) Filter ¶ added in v8.9.0
func (r *Termvectors) Filter(filter *types.TermVectorsFilter) *Termvectors
Filter Filter terms based on their tf-idf scores. API name: filter
func (*Termvectors) Header ¶
func (r *Termvectors) Header(key, value string) *Termvectors
Header set a key, value pair in the Termvectors headers map.
func (*Termvectors) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Termvectors) Id ¶
func (r *Termvectors) Id(id string) *Termvectors
Id Unique identifier of the document. API Name: id
func (*Termvectors) Offsets ¶
func (r *Termvectors) Offsets(offsets bool) *Termvectors
Offsets If `true`, the response includes term offsets. API name: offsets
func (*Termvectors) Payloads ¶
func (r *Termvectors) Payloads(payloads bool) *Termvectors
Payloads If `true`, the response includes term payloads. API name: payloads
func (*Termvectors) PerFieldAnalyzer ¶ added in v8.9.0
func (r *Termvectors) PerFieldAnalyzer(perfieldanalyzer map[string]string) *Termvectors
PerFieldAnalyzer Overrides the default per-field analyzer. API name: per_field_analyzer
func (Termvectors) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Termvectors) Positions ¶
func (r *Termvectors) Positions(positions bool) *Termvectors
Positions If `true`, the response includes term positions. API name: positions
func (*Termvectors) Preference ¶
func (r *Termvectors) Preference(preference string) *Termvectors
Preference Specifies the node or shard the operation should be performed on. Random by default. API name: preference
func (*Termvectors) Raw ¶
func (r *Termvectors) Raw(raw io.Reader) *Termvectors
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*Termvectors) Realtime ¶
func (r *Termvectors) Realtime(realtime bool) *Termvectors
Realtime If true, the request is real-time as opposed to near-real-time. API name: realtime
func (*Termvectors) Request ¶
func (r *Termvectors) Request(req *Request) *Termvectors
Request allows to set the request property with the appropriate payload.
func (*Termvectors) Routing ¶
func (r *Termvectors) Routing(routing string) *Termvectors
Routing Custom value used to route operations to a specific shard. API name: routing
func (*Termvectors) TermStatistics ¶
func (r *Termvectors) TermStatistics(termstatistics bool) *Termvectors
TermStatistics If `true`, the response includes term frequency and document frequency. API name: term_statistics
func (*Termvectors) Version ¶
func (r *Termvectors) Version(versionnumber string) *Termvectors
Version If `true`, returns the document version as part of a hit. API name: version
func (*Termvectors) VersionType ¶
func (r *Termvectors) VersionType(versiontype versiontype.VersionType) *Termvectors
VersionType Specific version type. API name: version_type