es

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

description: sync_eth

@author: xwc1125 @date: 2020/10/05

description: sync_eth

@author: xwc1125 @date: 2020/10/05

description: sync_eth

@author: xwc1125 @date: 2020/10/05

description: sync_eth

@author: xwc1125 @date: 2020/10/05

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

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

Types

type Buffer

type Buffer struct {
	*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"`
}

type Tweet

type Tweet struct {
	User     string                `json:"user" es:"text"`
	Message  string                `json:"message" es:"text"`
	Retweets int                   `json:"retweets"  es:"text"`
	Image    string                `json:"image,omitempty"  es:"text"`
	Created  time.Time             `json:"created,omitempty"  es:"store"`
	Tags     []string              `json:"tags,omitempty"  es:"text"`
	Location string                `json:"location,omitempty"`
	Suggest  *elastic.SuggestField `json:"suggest_field,omitempty"  es:"text"`
	A        float32
}

Jump to

Keyboard shortcuts

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