Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch Golang

Is it possible to identify multiple hosts with elastigo? I can't seem to find anything specific to that. Anyone using elastigo in a PROD setting? I would really like to attempt using a go based app for our web services, but we have a requirement with ElasticSearch, Redis and possibly a few others. Just not sure that the drivers for go are ready yet.

Any suggestions / info would be appreciated.

Thanks,

S

like image 888
scarpacci Avatar asked Feb 22 '15 00:02

scarpacci


People also ask

What is Elasticsearch Golang?

Phillip Edwards. Elasticsearch is a popular datastore for all types of information. It is distributed for speed and scalability and can index many types of content which makes it highly searchable. It uses simple REST APIs for ease of access.

How do I create an index in Elasticsearch using Golang?

Make a new index of Elasticsearch After you've deleted the Elastersearch cluster's old index, use the method CreateIndex() to make a new one in Golang. Pass the name of the index. Pass the string of Context mappings. Finally, pass the Context object instance.

What is Elasticsearch and how does it work?

Elasticsearch allows you to store, search, and analyze huge volumes of data quickly and in near real-time and give back answers in milliseconds. It's able to achieve fast search responses because instead of searching the text directly, it searches an index.


2 Answers

My answer could be a bit late, but still... I have recently (mid 2016) chosen olivere/elastic over elastigo as Elasticsearch Go client for our production application.

Reasons for the choice were:

  • olivere/elastic is under active development for the last year, while elastigo gets updated less and less regularly
  • As of 2016, developers recommend olivere/elastic more on the Internet

I would highly recommend you to have a look at olivere/elastic if you haven't made decision yet. Also there is a blog post Working With Elasticsearch in Go, which demonstrates on example how to use olivere/elastic to index and search documents. (In case you want to get a flavour of how the code looks like.)

like image 147
upitau Avatar answered Oct 03 '22 10:10

upitau


elastigo is working very well in a production setting for us. As far as detecting 'hosts' my best suggestion is to read the elasticsearch documentation which describes their cluster management scheme - most of that work is handled by elasticsearch itself. In our (rather straightforward) usage I've never had to think about anything beyond the server host address:port - nodes self-connect to a named cluster when brought online (with proper configuration parameters) and load balancing is handled within elasticsearch itself.

like image 31
snwight Avatar answered Oct 03 '22 11:10

snwight