Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBulkClient ¶
func NewBulkClient() esutil.BulkIndexer
Types ¶
type Search ¶
type Search interface { CreateIndex(index string, mapping Mapping) error Index(index string, body IndexBody) error Search(index string, body *SearchRequestBody) (*SearchResponse, error) }
func NewSearchWithConfig ¶
func NewSearchWithConfig(config elasticsearch.Config) Search
type SearchRequestBody ¶
type SearchRequestBody struct { DocValueFields any `json:"docvalue_fields,omitempty"` Fields any `json:"fields,omitempty"` StoredFields any `json:"stored_fields,omitempty"` Explain *bool `json:"explain,omitempty"` From int64 `json:"from"` IndicesBoost map[string]float64 `json:"indices_boost,omitempty"` KNN any `json:"knn,omitempty"` MinScore *float64 `json:"min_score,omitempty"` Pin any `json:"pin,omitempty"` Query map[string]any `json:"query,omitempty"` RuntimeMappings any `json:"runtime_mappings,omitempty"` SeqNoPrimaryTerm *bool `json:"seq_no_primary_term,omitempty"` Size *int64 `json:"size,omitempty"` Sort map[string]any `json:"sort,omitempty"` Source any `json:"_source,omitempty"` TerminateAfter *int64 `json:"terminate_after,omitempty"` Timeout *int64 `json:"timeout,omitempty"` Version *bool `json:"version,omitempty"` Aggs map[string]any `json:"aggs,omitempty"` }
func (*SearchRequestBody) BodyReader ¶
func (r *SearchRequestBody) BodyReader() (io.Reader, error)
type SearchResponse ¶
type SearchResponse struct { Took int64 `json:"took"` TimedOut bool `json:"timed_out"` Shards struct { Total int64 `json:"total"` Successful int64 `json:"successful"` Skipped int64 `json:"skipped"` Failed int64 `json:"failed"` } `json:"_shards"` Hits Hit `json:"hits"` Aggregations map[string]struct { Buckets []struct { KeyAsString string `json:"key_as_string"` Key int64 `json:"key"` DocCount int64 `json:"doc_count"` } `json:"buckets"` } `json:"aggregations"` }
Click to show internal directories.
Click to hide internal directories.