elastic

package
v0.0.0-...-41d5b9e Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDocIndex = "letitgo-property"

DefaultDocIndex to store property infos

View Source
const DefaultDocMapping = `` /* 714-byte string literal not displayed */

DefaultDocMapping to define the mapping

View Source
const DefaultIndex = "letitgo"

DefaultIndex of elastic

View Source
const DefaultMapping = `` /* 214-byte string literal not displayed */

DefaultMapping for DefaultIndex

Variables

This section is empty.

Functions

func SaveNodes

func SaveNodes(nodes []*Node) error

SaveNodes save nodes to elastic

Types

type Doc

type Doc struct {
	ID     int32    `json:"id"`
	Name   string   `json:"name"`
	Groups []*Group `json:"groups"`
}

Doc is a set of groups

func (*Doc) CreateRecords

func (d *Doc) CreateRecords() error

CreateRecords create records of properties

func (*Doc) String

func (d *Doc) String() string

type Group

type Group struct {
	ID         string      `json:"id"`
	Key        string      `json:"key"`
	Name       string      `json:"name"`
	ParentKey  string      `json:"parentKey"`
	Properties []*Property `json:"properties"`
}

Group some property together

type Node

type Node struct {
	GID    string                 `json:"gid"`
	ID     string                 `json:"id"`
	CIDs   []string               `json:"cids"`
	Clen   int32                  `json:"clen"`
	Groupk string                 `json:"groupk"`
	Kvs    map[string]interface{} `json:"kvs"`
}

Node of a n-tree

func (*Node) String

func (n *Node) String() string

type Origin

type Origin struct {
	DiseaseID  int                                 `json:"diseaseId"`
	HospitalID int                                 `json:"hospitalId"`
	DeptID     int                                 `json:"deptId"`
	SourceCode string                              `json:"sourceCode"`
	SourceID   string                              `json:"sourceId"`
	Docs       map[string][]map[string]interface{} `json:"docs"`
}

Origin disease info

func (*Origin) ParseNodes

func (o *Origin) ParseNodes() []*Node

ParseNodes parse the Origin to nodes

func (*Origin) String

func (o *Origin) String() string

type Property

type Property struct {
	ID    string `json:"id"`
	Key   string `json:"key"`
	Name  string `json:"name"`
	Etype string `json:"etype"`
}

Property describe the minimum element of a doc

func NewProperty

func NewProperty(id, key, name, etype string) *Property

NewProperty new a Property

type Record

type Record struct {
	Type     string    `json:"type"`
	Doc      *Doc      `json:"doc,omitempty"`
	Group    *Group    `json:"group,omitempty"`
	Property *Property `json:"property,omitempty"`
}

Record to es

Jump to

Keyboard shortcuts

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