i2es

package
v0.0.0-...-e8bbdd1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ESConf

type ESConf struct {
	Host  string
	Index string
	Type  string
}

ESConf ES connection settings

func (ESConf) AssignTopics

func (es ESConf) AssignTopics(messages []ESDoc) error

AssignTopics ...

func (ESConf) CheckID

func (es ESConf) CheckID(id string) (bool, error)

CheckID ...

func (ESConf) PutToIndex

func (es ESConf) PutToIndex(msg ESDoc) (ESDoc, error)

PutToIndex ...

type ESDoc

type ESDoc struct {
	Echo      string `json:"echo"`
	Subg      string `json:"subg"`
	To        string `json:"to"`
	Author    string `json:"author"`
	Message   string `json:"message"`
	Date      string `json:"date"`
	MsgID     string `json:"msgid"`
	Tags      string `json:"tags"`
	Repto     string `json:"repto"`
	Address   string `json:"address"`
	TopicID   string `json:"topicid"`
	Misplaced string `json:"misplaced"`
}

ESDoc Elasticsearch document structure

type ESRes

type ESRes struct {
	ScrollID string `json:"_scroll_id"`
	Took     int    `json:"took"`
	TimedOut bool   `json:"timed_out"`
	Hits     Hits   `json:"hits"`
}

ESRes ES response structure

type Hit

type Hit struct {
	Index  string  `json:"_index"`
	Type   string  `json:"_type"`
	ID     string  `json:"_id"`
	Score  float32 `json:"_score"`
	Source ESDoc   `json:"_source"`
}

ES Document

type Hits

type Hits struct {
	Total    int     `json:"total"`
	MaxScore float32 `json:"max_score"`
	Hits     []Hit   `json:"hits"`
}

Hits Founded documents

Jump to

Keyboard shortcuts

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