utilElasticsearch

package
v0.0.0-...-eb9ff8e Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticsearchClient

type ElasticsearchClient struct {
	*elastic.Client
	// contains filtered or unexported fields
}

func NewElasticsearchClient

func NewElasticsearchClient(conf *ElasticsearchClientConfig) (esClient *ElasticsearchClient, err error)

func (*ElasticsearchClient) Aggregate

func (esClient *ElasticsearchClient) Aggregate(indexName string, group map[string]elastic.Aggregation, filter elastic.Query) (searchResult *elastic.SearchResult, err error)

func (*ElasticsearchClient) Delete

func (esClient *ElasticsearchClient) Delete(indexName string, filter *QueryFilter) (count int64, err error)

func (*ElasticsearchClient) GetMap

func (esClient *ElasticsearchClient) GetMap(indexName string) (mapping string, err error)

func (*ElasticsearchClient) New

func (esClient *ElasticsearchClient) New() (newClient *ElasticsearchClient, err error)

func (*ElasticsearchClient) SaveData

func (esClient *ElasticsearchClient) SaveData(indexName string, data []interface{}) (err error)

func (*ElasticsearchClient) Select

func (esClient *ElasticsearchClient) Select(results interface{}, indexName string, filter *QueryFilter, sort map[string]bool, limit int64, offset int64, lastSort *QueryLastSort) (total int64, err error)

func (*ElasticsearchClient) SetMap

func (esClient *ElasticsearchClient) SetMap(indexName string, mapping string) (err error)

func (*ElasticsearchClient) Update

func (esClient *ElasticsearchClient) Update(indexName string, filter *QueryFilter, script *elastic.Script) (count int64, err error)

type ElasticsearchClientConfig

type ElasticsearchClientConfig struct {
	Addr        string
	User        string
	Password    string
	Debug       bool
	ErrorLogger elastic.Logger
	InfoLogger  elastic.Logger
}

type ElasticsearchMapping

type ElasticsearchMapping struct {
	Settings interface{} `json:"settings"`
	Mappings interface{} `json:"mappings"`
}

type QueryFilter

type QueryFilter struct {
	QuerySource interface{}
}

func (*QueryFilter) Source

func (fq *QueryFilter) Source() (interface{}, error)

type QueryLastSort

type QueryLastSort []interface{}

Jump to

Keyboard shortcuts

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