utilElasticsearch

package
v0.0.0-...-5f3621a Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MulanPSL-2.0 Imports: 11 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 {
	// 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) GetMap

func (esClient *ElasticsearchClient) GetMap(indexName string) (mapping string, 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)

type ElasticsearchClientConfig

type ElasticsearchClientConfig struct {
	Addr     string
	User     string
	Password string
}

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