es

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package es

@author: xwc1125 @date: 2020/9/7 0007

Package es

@author: xwc1125 @date: 2020/8/14 0014

Package es

@author: xwc1125 @date: 2020/9/4 0004

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel2Case

func Camel2Case(name string) string

func Mapping

func Mapping(m interface{}) string

Mapping 获取m对象的mapping 需要注意的是:结构体的json字符串需为下划线的形式(UnderScoreCase)

Types

type Buffer

type Buffer struct {
	*bytes.Buffer
}

Buffer 内嵌bytes.Buffer,支持连写

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Append

func (b *Buffer) Append(i interface{}) *Buffer

type ES

type ES struct {
	// contains filtered or unexported fields
}

func NewES

func NewES(hosts []string) (*ES, error)

func (*ES) BulkIndexRequest

func (es *ES) BulkIndexRequest(index string) *elastic.BulkIndexRequest

批量创建时

func (*ES) Client

func (es *ES) Client() *elastic.Client

type EsMappings

type EsMappings struct {
	Settings *Settings `json:"settings,omitempty"`
	Mappings *Mappings `json:"mappings,omitempty"`
}

func (EsMappings) String

func (e EsMappings) String() string

type Mappings

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

type Property

type Property struct {
	Type      string `json:"type"`
	Store     bool   `json:"store,omitempty"`
	Fielddata bool   `json:"fielddata,omitempty"`
}

type Settings

type Settings struct {
	NumberOfShards   int64 `json:"number_of_shards,omitempty"`
	NumberOfReplicas int64 `json:"number_of_replicas,omitempty"`
}

Jump to

Keyboard shortcuts

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