goes

package
v1.2.93 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-es

目前:v7
https://github.com/olivere/elastic

官方:v7 v8
https://github.com/elastic/go-elasticsearch

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default added in v1.2.83

func Default() *client

func GetClient added in v1.2.83

func GetClient(names ...string) *client

func Init

func Init(conf Config, options ...elastic.ClientOptionFunc) (err error)

可以多次调用初始化多个实例

func New

func New(conf Config, options ...elastic.ClientOptionFunc) (cli *client, err error)

Types

type BoolQueryAction

type BoolQueryAction string
var (
	BoolQueryMust    BoolQueryAction = "must"
	BoolQueryFilter  BoolQueryAction = "filter"
	BoolQueryShould  BoolQueryAction = "should"
	BoolQueryMustNot BoolQueryAction = "must_not"
)

type Config

type Config struct {
	Name      string `json:"name,optional"  yaml:"Name"`
	Addr      string `json:"addr,optional"  yaml:"Addr"`
	User      string `json:"user,optional"  yaml:"User"`
	Password  string `json:"password,optional"  yaml:"Password"`
	EnableLog bool   `json:"enableLog,optional"  yaml:"EnableLog"`
}

type Pagination

type Pagination struct {
	Sort   string // 排序字段
	Order  bool   // true=升序 false=降序
	Offset int
	Limit  int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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