client

package
v3.0.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDocumentOptions

type AddDocumentOptions struct {
	DocumentType string // Deprecated - not used by newer versions of elasticsearch
	Upsert       bool
}

type BulkIndexerAction

type BulkIndexerAction string

type Client

type Client interface {
	AddDocument(ctx context.Context, indexName, documentID string, document []byte, opts *AddDocumentOptions) error
	BulkUpdate(ctx context.Context, indexName, url string, settings []byte) ([]byte, error)
	BulkIndexAdd(ctx context.Context, action BulkIndexerAction, index, documentID string, document []byte) error
	BulkIndexClose(context.Context) error
	Checker(ctx context.Context, state *health.CheckState) error
	CreateIndex(ctx context.Context, indexName string, indexSettings []byte) error
	DeleteIndex(ctx context.Context, indexName string) error
	DeleteIndices(ctx context.Context, indices []string) error
	GetAlias(ctx context.Context) ([]byte, error)
	GetIndices(ctx context.Context, indexPatterns []string) ([]byte, error)
	NewBulkIndexer(context.Context) error
	UpdateAliases(ctx context.Context, alias string, removeIndices, addIndices []string) error
	MultiSearch(ctx context.Context, searches []Search) ([]byte, error)
	Search(ctx context.Context, search Search) ([]byte, error)
	CountIndices(ctx context.Context, indices []string) ([]byte, error)
}

type Config

type Config struct {
	ClientLib  Library
	MaxRetries int
	Address    string
	Indexes    []string
	Transport  http.RoundTripper
}

Config holds the configuration of search client

type Header struct {
	Index string `json:"index"`
}

type Library

type Library string
const (
	GoElasticV710 Library = "GoElastic_v710"
	OpenSearch    Library = "OpenSearch"
)
type Search struct {
	Header Header
	Query  []byte
}

Directories

Path Synopsis
elasticsearch
v2

Jump to

Keyboard shortcuts

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