es

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	Properties map[string]map[string]string `json:"properties"`
}

type EsClient

type EsClient struct {
	Client     *elastic.Client
	InfoLogger *log.Logger
	ErrLogger  *log.Logger
}

func NewEsClient

func NewEsClient() (*EsClient, error)

func (*EsClient) CreateIndex

func (c *EsClient) CreateIndex(i *Index, indexName string) (err error)

func (*EsClient) DelIndex

func (c *EsClient) DelIndex(indexName string) error

func (*EsClient) Delete

func (c *EsClient) Delete(index, id string) error

func (*EsClient) GetById

func (c *EsClient) GetById(index, id string) (interface{}, error)

func (*EsClient) GetWhere

func (c *EsClient) GetWhere(index string, termQuery elastic.Query, sortField string, asc bool, offset, size int) ([]interface{}, error)

func (*EsClient) Insert

func (c *EsClient) Insert(index, id string, bodyJson interface{}) error

func (*EsClient) Update

func (c *EsClient) Update(index, id string, bodyJson interface{}) error

type Index

type Index struct {
	Settings struct {
		NumberOfShards   int `json:"number_of_shards"`
		NumberOfReplicas int `json:"number_of_replicas"`
	} `json:"settings"`
	Mappings Mappings `json:"mappings"`
}

func NewIndexTemplate

func NewIndexTemplate() *Index

func (*Index) InjectIndex

func (index *Index) InjectIndex(s interface{})

type Mappings

type Mappings struct {
	Doc Doc `json:"doc"`
}

Jump to

Keyboard shortcuts

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