Skip to content

Simple go library to index and search from elastic search with ease

Notifications You must be signed in to change notification settings

KrishKayc/esquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esquery

Simple go library to index and search from elastic search with ease

Usage

Initialize client

esClient := esquery.ESClient{Url: "http://localhost:9200", IndexName: "person"}

esClient.Init()

Index documents

person1 := &Person{Name: "test", Age: "20", Gender: "male"}

b, err := json.Marshal(person1)

esClient.Index(string(b), "true")

Search Easily with 'Built-In' functions

term

query := esquery.NewQuery()

term := query.Term("Name", "test")

query.AddPart(term)

response, _ := esClient.Search(query)

match

query := esquery.NewQuery()

match := query.Match("Name", "test")

query.AddPart(match)

response, _ := esClient.Search(query)

Supported ES descriptors

Term, Match, Bool, Must, Should, Filter.. yet to come.

About

Simple go library to index and search from elastic search with ease

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages