Skip to content

apisearch/elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 tag 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 tag 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))

About

Docker image with elasticsearch 5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published