es

package
Version: v0.0.0-...-2443ee7 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 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

Source Files

Jump to

Keyboard shortcuts

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