Public | Automated Build

Last pushed: 8 months ago
Short Description
Elasticsearch 5 that works with golang projects
Full Description

Elasticsearch 5 for Golang apps

Default elasticsearch does not work with Golang projetcs. Added config which fixes this problem.

Installed some additional things:

  • ICU plugin
  • Czech dictionary

Native vs dockerized golang app

There is problem with Elasticsearch network settings when trying to connect from Golang app.
Here is settings which works for me:

Running Golang app natively with dockerized ES

  • GitHub branch of Elasticsearch: develop
  • Docker tak of ES: apisearch/elasticsearch:develop
  • expose port 9200 of ES container
  • Golang app connection config:
import "gopkg.in/olivere/elastic.v5"
client, err := elastic.NewClient(elastic.SetURL("http://localhost:9200"))

Running Golang inside Docker container with dockerized ES

  • GitHub branch of Elasticsearch: master
  • Docker tak of ES: apisearch/elasticsearch:latest
  • Golang app connection config (replace elasticsearch with name of your container):
import "gopkg.in/olivere/elastic.v5"
client, err := elastic.NewClient(elastic.SetURL("http://elasticsearch:9200"), elastic.SetSniff(false))
Docker Pull Command
Owner
apisearch
Source Repository

Comments (0)