es

package
v0.0.0-...-e90a610 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 4 Imported by: 0

README

elasticsearch

go elasticsearch client based on https://github.com/olivere/elastic

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndCreate

func CheckAndCreate(index string, bodyString string) (cIndex *elastic.IndicesCreateResult, err error)

CheckAndCreate creates index if not exists

func CheckAndDelete

func CheckAndDelete(index string) (dIndex *elastic.IndicesDeleteResponse, err error)

CheckAndDelete deletes index if exists

func Index

func Index(idx string, docs []Document) error

Index index documents to elasticsearch

func Init

func Init(hosts []string, enableAuth bool, username, password string) (err error)

Init initializes default client

func UpdateSettings

func UpdateSettings(index string, setting map[string]interface{}) (uIndex *elastic.IndicesPutSettingsResponse, err error)

UpdateSettings update index settings

Types

type Document

type Document interface {
	Index() string
	Type() string
	ID() string
}

Document interface

Jump to

Keyboard shortcuts

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