Practical Elasticsearch

Índice

Volver a davidam.com

1 Introduction

This document is only my personal notes about this software.

Elasticsearch is a highly scalable open-source full-text search and analytics engine. It allows you to store, search, and analyze big volumes of data quickly and in near real time. It is generally used as the underlying engine/technology that powers applications that have complex search features and requirements.

2 Installation

3 Checking

http://localhost:9200/

4 List indexes

http://localhost:9200/_cat/indices

5 List indexes in json

$ curl 'http://localhost:9200/_cat/indices?pretty' -H "Accept: application/json"

6 Show an index

$ wget http://localhost:9200/dam-index/

7 Searching in an index

$ wget -c http://localhost:9200/dam-index/_search

8 The cluster state API allows to get a comprehensive state information of the whole cluster.

$ wget http://localhost:9200/_cluster/state

9 Master

http://localhost:9200/_cat/master?v

10 Show nodes

$ wget -c http://localhost:9200/_cat/nodes?h=ip,port,heapPercent,name
$ curl http://localhost:9200/_cat/nodes?v

11 Show cluster health

http://localhost:9200/_cluster/health

12 Elasticdump

12.1 json to the index

$ elasticdump --input=git_openstack_data.json --output=http://localhost:9200 --output-index=dam-index --type=data
$ elasticdump --input=git_openstack_mapping.json --output=http://localhost:9200 --output-index=dam-index --type=mapping

12.2 index data to json

$ elasticdump  --input=http://production.es.com:9200/my_index --output=/data/my_index_mapping.json --type=mapping
$ elasticdump  --input=http://production.es.com:9200/my_index --output=/data/my_index.json --type=data

13 License

Copyright (C) 2018 David Arroyo Menendez Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in GNU Free Documentation License.

200px-GFDL_Logo.svg.png

Fecha: 26/03/2018

Autor: David Arroyo Menéndez

Created: 2018-04-04 mié 17:45

Emacs 24.5.1 (Org mode 8.2.10)

Validate