8000 GitHub - richiecheng97/esLog: elasticsearch log golang 的elasticsearch 日志封装,包括搜索,查询,添加等
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
forked from xxjwxc/esLog

elasticsearch log golang 的elasticsearch 日志封装,包括搜索,查询,添加等

Notifications You must be signed in to change notification settings

richiecheng97/esLog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esLog

elasticsearch log golang 的elasticsearch

Log encapsulation, including search, query, add, etc.

中文版

elasticsearch Log Encapsulation Types

  • install
 go get gopkg.in/olivere/elastic.v5

  • init
	e,err := New(WithIndexName("wms_log"), WithAddrs("http://192.168.198.17:9200/"))
  • add
	e,err := New(WithIndexName("wms_log"), WithAddrs("http://192.168.198.17:9200/"))

	var eslog es.ESLog
    ...

	b := e.Add(es.Index, es.Index, "", eslog)
	if !b {
		fmt.Println(e.Err)
	}
  • search
//Precise search
term := make(map[string]interface{})
...
//Fuzzy matching
match := make(map[string]interface{})
...
//Time Search
timeCase := make(map[string]es.CaseSection)
...

eslist := tools.Search(term, match, timeCase, req.Page, req.Limit)
  • case

if import github.com/olivere/elastic must remove *hit.Source on *

  • more

link

About

elasticsearch log golang 的elasticsearch 日志封装,包括搜索,查询,添加等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
0