elastic

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregations

type Aggregations map[string]JSONDummy

type Client

type Client interface {
	Info() (*ResultInfo, error)
	GetDSLAPI() *dsl.API
	Search(index string, srch any) (*SearchResult, error)
}

type Error

type Error struct {
	RootCause []RootCause `json:"root_cause,omitempty"`
	Type      string      `json:"type,omitempty"`
	Reason    string      `json:"reason,omitempty"`
	Line      int         `json:"line,omitempty"`
	Col       int         `json:"col,omitempty"`
}

type FakeElasticRoundTripper

type FakeElasticRoundTripper struct {
	// contains filtered or unexported fields
}

FakeElasticRoundTripper is used for Elasticsearch 7.x instances which do not send the required "X-Elastic-Product" header. This Problem seems to be solved on Elasticsearch 8.x

func NewFakeElasticRoundTripper

func NewFakeElasticRoundTripper(originalTransport http.RoundTripper) FakeElasticRoundTripper

func (FakeElasticRoundTripper) RoundTrip

func (t FakeElasticRoundTripper) RoundTrip(r *http.Request) (*http.Response, error)

type Hit

type Hit struct {
	Index  string         `json:"_index"`
	ID     string         `json:"_id"`
	Score  float32        `json:"_score,omitempty"`
	Source any            `json:"_source,omitempty"`
	Fields map[string]any `json:"fields,omitempty"`
}

type Hits

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

type JSONDummy

type JSONDummy []byte

JSONDummy reflects json value as []byte

func (*JSONDummy) UnmarshalJSON

func (a *JSONDummy) UnmarshalJSON(data []byte) error

type ResultInfo

type ResultInfo struct {
	Name        string `json:"name,omitempty"`
	ClusterName string `json:"cluster_name,omitempty"`
	ClusterUUID string `json:"cluster_uuid,omitempty"`
	Version     struct {
		Number                           string    `json:"number,omitempty"`
		BuildFlavor                      string    `json:"build_flavor,omitempty"`
		BuildType                        string    `json:"build_type,omitempty"`
		BuildHash                        string    `json:"build_hash,omitempty"`
		BuildDate                        time.Time `json:"build_date,omitempty"`
		BuildSnapshot                    bool      `json:"build_snapshot,omitempty"`
		LuceneVersion                    string    `json:"lucene_version,omitempty"`
		MinimumWireCompatibilityVersion  string    `json:"minimum_wire_compatibility_version,omitempty"`
		MinimumIndexCompatibilityVersion string    `json:"minimum_index_compatibility_version,omitempty"`
	} `json:"version,omitempty"`
	Tagline string `json:"tagline,omitempty"`
}

type ResultRelation

type ResultRelation string
const (
	ResultRelationEQ  ResultRelation = "eq"
	ResultRelationGTE ResultRelation = "gte"
)

type RootCause

type RootCause struct {
	Type   string `json:"type,omitempty"`
	Reason string `json:"reason,omitempty"`
	Line   int    `json:"line,omitempty"`
	Col    int    `json:"col,omitempty"`
}

type SearchConfig

type SearchConfig struct {
	Index          string
	Fields         map[string][]string
	QStr           string
	FiltersFields  map[string][]string
	Facets         map[string]TermFacet
	Groups         []string
	ContentVisible bool
	Start          int
	Rows           int
	IsAdmin        bool
}

type SearchResult

type SearchResult struct {
	ScrollID     string       `json:"_scroll_id,omitempty"`
	Took         int          `json:"took,omitempty"`
	TimedOut     bool         `json:"timed_out,omitempty"`
	Shards       *Shard       `json:"_shards,omitempty"`
	Hits         *Hits        `json:"hits,omitempty"`
	Aggregations Aggregations `json:"aggregations,omitempty"`
	Error        *Error       `json:"error,omitempty"`
	Status       int          `json:"status,omitempty"`
}

type Shard

type Shard struct {
	Total      int `json:"total,omitempty"`
	Successful int `json:"successful,omitempty"`
	Skipped    int `json:"skipped,omitempty"`
	Failed     int `json:"failed,omitempty"`
}

type TermFacet

type TermFacet struct {
	Selected map[string]bool
	Prefix   string
	Limit    int64
}

type Total

type Total struct {
	Value    int            `json:"value,omitempty"`
	Relation ResultRelation `json:"relation,omitempty"`
}

Jump to

Keyboard shortcuts

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