ElasticSearch
Revision as of 08:15, 15 April 2019 by Rafahsolis (talk | contribs)
Install
- Install Java
sudo apt install openjdk-7-jre-headless
Download Debian package from elastic.co
sudo dpkg -i elasticsearch-X.X.X.deb
API
Get status
curl -X GET "http://localhost:9200"
Paths
| Type | Description | Location (Debian) |
|---|---|---|
| Home | Home of Elastic Search Installation | /usr/share/elasticsearch |
| Bin | Binary scripts including elasticsearch to start a node | /usr/share/elasticsearch/bin |
| Conf | Configuration file elasticsearch.yml | /etc/elasticsearch |
| data | The location of the data files of each index or shard allocated on the node | /etc/elasticsearch |
| logs | Log file location | /var/log/elasticsearch |
| plugins | Plugin directories location | /usr/share/elasticsearch/plugins |
Plugins
Site Plugins
- Head: Swiss Army Knife for ElasticSearch cluster topology & cluster status, table views & API frontend views
- BigDesk: Statistics, charts
- Kopf: Cluster administration & query tool
Analysis Plugins
- SmartCN: Analyze Chinese text
QueryDSL vs RDMBS
| Elastic Search | RDMBS |
|---|---|
| Index | Database |
| Type | Table |
| Document | Row |
| Field | Column |
| Mapping | Schema |
| Query DSL | SQL |
| Get API | Select * FROM |
| POST API | UPDATE <TABLE> SET |
| PUT API | INSERT INTO <TABLE> |
| Everything is indexed | Index on demand |
| Aggregation | SELECT <FIELD>, COUNT (*) FROM <TABLE> |