es

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

elasticsearch文档

基础介绍 https://blog.csdn.net/ubuntutouch/article/details/102728604

使用 https://www.cnblogs.com/thepoy/p/14717479.html

###对比:

关系数据库 ⇒ 数据库 ⇒ 表 ⇒ 行 ⇒ 列(Columns)

Elasticsearch ⇒ 索引(Index) ⇒ 类型(type) ⇒ 文档(Docments) ⇒ 字段(Fields)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEsV7

func NewEsV7(c Config) *elasticsearchV7.Client

func NewEsV8

func NewEsV8(c Config) *elasticsearchV8.Client

Types

type Config

type Config struct {
	Addrs []string `mapstructure:"addrs"`
}

type SearchResponse

type SearchResponse struct {
	Took     uint64 `json:"took"`
	TimedOut bool   `json:"timed_out"`
	Shards   struct {
		Total      uint64 `json:"total"`
		Successful uint64 `json:"successful"`
		Skipped    uint64 `json:"skipped"`
		Failed     uint64 `json:"failed"`
	} `json:"_shards"`
	Hits         *SearchResponseHits        `json:"hits"`
	Aggregations map[string]json.RawMessage `json:"aggregations"`
}

type SearchResponseHits

type SearchResponseHits struct {
	Total struct {
		Value    uint64 `json:"value"`
		Relation string `json:"relation"`
	} `json:"total"`
	MaxScore float64                   `json:"max_score"`
	Hits     []*SearchResponseHitsHits `json:"hits"`
}

type SearchResponseHitsHits

type SearchResponseHitsHits struct {
	Index  string          `json:"_index"`
	Type   string          `json:"_type"`
	ID     string          `json:"_id"`
	Score  float64         `json:"_score"`
	Source json.RawMessage `json:"_source"`
}

Jump to

Keyboard shortcuts

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