elastic

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ElasticV6 = "v6" // elastic v6 版本
	ElasticV7 = "v7" // elastic v7 版本
)
View Source
const (
	BoolTypeFilter = iota
	BoolTypeMust
	BoolTypeShould
	BoolTypeMustNot
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EsFilter

type EsFilter interface {
	Source() (interface{}, error)
}

type HighLight

type HighLight struct {
	Fields  []string `json:"fields,omitempty"`   // 要加高亮的字段
	PreTag  string   `json:"pre_tag,omitempty"`  // 高亮前标签
	PostTag string   `json:"post_tag,omitempty"` // 高亮后标签
}

HighLight 返回结果高亮

type Query

type Query struct {
	OP                 string
	Path               string
	Index              []string
	Type               string
	Column             []string
	Where              map[string]interface{}
	Data               map[string]interface{}
	Datas              []map[string]interface{}
	Page               int
	Size               int
	From               uint64
	Order              []string
	Refresh            string
	Routing            string
	Script, ScriptType string
	Source             string
	Scroll             *proto.Scroll
	HighLight          *HighLight

	// Params
	Params types.Map

	Addr    *util.DBAddress
	TimeLog *log.TimeLog
	// contains filtered or unexported fields
}

func (*Query) Printf

func (q *Query) Printf(format string, v ...interface{})

Printf 实现 elastic Logger 接口

func (*Query) Query

func (q *Query) Query(ctx context.Context) (interface{}, *proto.Detail, bool, error)

Query 从 es 获取数据

func (*Query) SetParams

func (q *Query) SetParams(req *filter.Request,
	prop *obj.Property, addr *util.DBAddress, transInfo *obj.TransInfo) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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