Skip to content

Instantly share code, notes, and snippets.

@palash25
Last active May 28, 2020 14:32
Show Gist options
  • Select an option

  • Save palash25/06ed4039d556f8f8d39ebcc81dadfca9 to your computer and use it in GitHub Desktop.

Select an option

Save palash25/06ed4039d556f8f8d39ebcc81dadfca9 to your computer and use it in GitHub Desktop.

ES

  • Error: ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]

  • Solution/Reason: Fielddata was disabled

  • Caution: The solution isn't always to turn on fielddata since turning it on will increase the memory consumption by ES (because it creates an inverted index) instead append .keyword to the field name as a workaround.

  • Text fields: These are analyzed fields that can be used for full-text search (exact matches are not needed and docs can be searched using tokens)

  • Keyword fields: These are non-analyzed fields that are used for keyword search (need exact matches to return docs)

Golang ES

  • To view the structure of a constructed query do this
 src, _ := finalQuery.Source()
blah, _ := json.Marshal(src)
fmt.Println(string(blah), "\n")
  • Access locally running elasticsearch instace from a docker container by adding this to the ES config file and using this url from the code running in the container http://172.17.0.1:9200
 network.host: 0.0.0.0
 transport.host: localhost
 transport.tcp.port: 9300

Docker

Error: docker/compose#4950 Notes: Port was already free Solution: Restart the docker daemon

Git

  • Delete a commit in the middle of the log git rebase -i <commit-hash>~1, editor opens up, delete the commits that are not required and make sure any subsequent commits don't cause merge conflicts. If not then rebase will do the rest of the job.

Linux

  • To check for services enabled on startup and to disable th- em use the following systemctl is-enabled SERVICE systemctl disable SERVICE systemctl is-enabled SERVICE systemctl disable SERVICE
  • In case llvm install fails because of no public key take a look at this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment