Photo by Jeremy Bishop on Unsplash

Elasticsearch, search power at your fingertips!

But what is exactly ES?

Sounds good, but what is possible to do with it?

How it works?

Example of ES logical architecture

Awesome, I want to try it!

Run ES on Docker (Linux)

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.4.0
// 20180929194325
// http://localhost:9200/
{
"name": "1LoBYJR",
"cluster_name": "docker-cluster",
"cluster_uuid": "DxChiMm5Rku9KVqjPz5JDQ",
"version": {
"number": "6.4.0",
"build_flavor": "default",
"build_type": "tar",
"build_hash": "595516e",
"build_date": "2018-08-17T23:18:47.308994Z",
"build_snapshot": false,
"lucene_version": "7.4.0",
"minimum_wire_compatibility_version": "5.6.0",
"minimum_index_compatibility_version": "5.0.0"
},
"tagline": "You Know, for Search"
}
version: '2'services:  elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ~/esdata:/usr/share/elasticsearch/data
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
kibana:
image: docker.elastic.co/kibana/kibana:6.4.0
ports:
- "5601:5601"
networks:
- elk
depends_on:
- elasticsearch
networks:
elk:
driver: bridge
docker-compose up
PUT /shakespeare
{
"mappings": {
"doc": {
"properties": {
"speaker": {"type": "keyword"},
"play_name": {"type": "keyword"},
"line_id": {"type": "integer"},
"speech_number": {"type": "integer"}
}
}
}
}
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json

Tech consultant (antonellocalamea.com) | Avid learner | Composer | Proudly believing less is more, except for love and knowledge

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store