Documentation
¶
Overview ¶
Allows to retrieve a large numbers of results from a single search request.
Index ¶
- Variables
- type NewScroll
- type Request
- type Response
- type Scroll
- func (r Scroll) Do(providedCtx context.Context) (*Response, error)
- func (r *Scroll) Header(key, value string) *Scroll
- func (r *Scroll) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r Scroll) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Scroll) Raw(raw io.Reader) *Scroll
- func (r *Scroll) Request(req *Request) *Scroll
- func (r *Scroll) RestTotalHitsAsInt(resttotalhitsasint bool) *Scroll
- func (r *Scroll) Scroll(duration types.Duration) *Scroll
- func (r *Scroll) ScrollId(scrollid string) *Scroll
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 NewScroll ¶
type NewScroll func() *Scroll
NewScroll type alias for index.
func NewScrollFunc ¶
func NewScrollFunc(tp elastictransport.Interface) NewScroll
NewScrollFunc returns a new instance of Scroll 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 { // Scroll Period to retain the search context for scrolling. Scroll types.Duration `json:"scroll,omitempty"` // ScrollId Scroll ID of the search. ScrollId string `json:"scroll_id"` }
Request holds the request body struct for the package scroll
func (*Request) UnmarshalJSON ¶
type Response ¶
type Response struct { Aggregations map[string]types.Aggregate `json:"aggregations,omitempty"` Clusters_ *types.ClusterStatistics `json:"_clusters,omitempty"` Fields map[string]json.RawMessage `json:"fields,omitempty"` Hits types.HitsMetadata `json:"hits"` MaxScore *types.Float64 `json:"max_score,omitempty"` NumReducePhases *int64 `json:"num_reduce_phases,omitempty"` PitId *string `json:"pit_id,omitempty"` Profile *types.Profile `json:"profile,omitempty"` ScrollId_ *string `json:"_scroll_id,omitempty"` Shards_ types.ShardStatistics `json:"_shards"` Suggest map[string][]types.Suggest `json:"suggest,omitempty"` TerminatedEarly *bool `json:"terminated_early,omitempty"` TimedOut bool `json:"timed_out"` Took int64 `json:"took"` }
Response holds the response body struct for the package scroll
func (*Response) UnmarshalJSON ¶
type Scroll ¶
type Scroll struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Scroll
Allows to retrieve a large numbers of results from a single search request.
func (Scroll) Do ¶
Do runs the request through the transport, handle the response and returns a scroll.Response
func (*Scroll) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (Scroll) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Scroll) 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 (*Scroll) RestTotalHitsAsInt ¶
RestTotalHitsAsInt If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. API name: rest_total_hits_as_int