v1

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationBucket

type AggregationBucket struct {
	Key          string                         `json:"key"`
	DocCount     uint64                         `json:"doc_count"`
	Aggregations map[string]AggregationResponse `json:"aggregations,omitempty"`
}

type AggregationDateRange

type AggregationDateRange struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
}

type AggregationNumberRange

type AggregationNumberRange struct {
	From float64 `json:"from"`
	To   float64 `json:"to"`
}

type AggregationParams

type AggregationParams struct {
	AggType      string                       `json:"agg_type"`
	Field        string                       `json:"field"`
	WeightField  string                       `json:"weight_field"` // Field name to be used for setting weight for primary field for weighted average aggregation
	Size         int                          `json:"size"`
	Ranges       []AggregationNumberRange     `json:"ranges"`
	DateRanges   []AggregationDateRange       `json:"date_ranges"`
	Aggregations map[string]AggregationParams `json:"aggs"`
}

type AggregationResponse

type AggregationResponse struct {
	Value   interface{}         `json:"value,omitempty"`
	Buckets []AggregationBucket `json:"buckets,omitempty"`
}

type Hit

type Hit struct {
	Index     string                 `json:"_index"`
	Type      string                 `json:"_type"`
	ID        string                 `json:"_id"`
	Score     float64                `json:"_score"`
	Timestamp time.Time              `json:"@timestamp"`
	Source    interface{}            `json:"_source"`
	Highlight map[string]interface{} `json:"highlight,omitempty"`
}

type Hits

type Hits struct {
	Total    Total   `json:"total"`
	MaxScore float64 `json:"max_score"`
	Hits     []Hit   `json:"hits"`
}

type QueryHighlight

type QueryHighlight struct {
	Fields []string `json:"fields"`
	Style  string   `json:"style"`
}

type QueryParams

type QueryParams struct {
	Boost     int        `json:"boost"`
	Term      string     `json:"term"`
	Terms     [][]string `json:"terms"` // For multi phrase query
	Field     string     `json:"field"`
	StartTime time.Time  `json:"start_time"`
	EndTime   time.Time  `json:"end_time"`
}

type SearchResponse

type SearchResponse struct {
	Took         int                            `json:"took"` // Time it took to generate the response
	TimedOut     bool                           `json:"timed_out"`
	Hits         Hits                           `json:"hits"`
	Aggregations map[string]AggregationResponse `json:"aggregations,omitempty"`
	Error        string                         `json:"error,omitempty"`
}

SearchResponse for a query

type Source

type Source struct {
	Enable bool            // enable _source returns, default is true
	Fields map[string]bool // what fields can returns
}

type Total

type Total struct {
	Value int `json:"value"` // Count of documents returned
}

type ZedQuery

type ZedQuery struct {
	// SearchType is the type of search to perform. Can be match, match_phrase, query_string, etc
	SearchType   string                       `json:"search_type"`
	MaxResults   int                          `json:"max_results"`
	From         int                          `json:"from"`
	Explain      bool                         `json:"explain"`
	Highlight    *meta.Highlight              `json:"highlight"`
	Query        QueryParams                  `json:"query"`
	Aggregations map[string]AggregationParams `json:"aggs"`
	SortFields   []string                     `json:"sort_fields"`
	Source       interface{}                  `json:"_source"`
}

ZedQuery is the query object for the zed index. All search requests should send this struct

type ZedQueryForSDK

type ZedQueryForSDK struct {
	// SearchType is the type of search to perform. Can be match, match_phrase, query_string, etc
	SearchType   string                       `json:"search_type"`
	MaxResults   int                          `json:"max_results"`
	From         int                          `json:"from"`
	Explain      bool                         `json:"explain"`
	Highlight    *meta.Highlight              `json:"highlight"`
	Query        QueryParams                  `json:"query"`
	Aggregations map[string]AggregationParams `json:"aggs"`
	SortFields   []string                     `json:"sort_fields"`
	Source       []string                     `json:"_source"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL