이번 포스트는 Elasticsearch를 공부하면서 참고한 자료들을 단순히 주제별로 정리한 포스트입니다.
1. ELK 스택
Elasticsearch + Logstash + Kibana 스택 구축 가이드
Digital Ocean - [how to install]
2. elasticsearch-dump [엘라스틱서치-덤프]
엘라스틱 서치에 있는 파일들을 json 포맷이나 csv 포맷으로 저장하는 파이썬 모듈
2.1. Copy
-
elasticdump --input=http://SERVER/INDEX --output=http://SERVER/NEW_INDEX --type=mapping
-
elasticdump --input=http://SERVER/INDEX --output=http://SERVER/NEW_INDEX--type=data
2.2. Backup
-
elasticdump --input=http://SERVER/INDEX --output=./index_mapping.json --type=mapping
-
elasticdump --input=http://SERVER/INDEX --output=./index_data.json --type=data
3. elasticsearch command [엘라스틱 서치 공식 가이드]
curl -x ( command ) "localhost:9200/index/doc_type"
3.1. search
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html
3.2. index
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html
3.3. delete
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
3.4. merge
curl -XPOST 'localhost:9200/kimchy,elasticsearch/_forcemerge?pretty'
Best way, using reindex API
POST _reindex { "conflicts": "proceed", "source": { "index": ["twitter", "blog"], "type": ["tweet", "post"] }, "dest": { "index": "all_together" } }
3.5. mapping
PUT post { "mappings":{ "nulled":{ "properties":{ "user":{ "type":"text" }, "title":{ "type":"text" }, "detail":{ "type":"text" }, "url":{ "type":"text" }, "datetime":{ "type":"date","format":"YYYY-MM-dd HH:mm" } } } }
'Open source > Elasticsearch' 카테고리의 다른 글
[Open source] elasticsearch - 03. Python Helpers - Bulk API 사용법 (0) | 2020.02.29 |
---|---|
[Open source] elasticsearch - 02. 인덱스 변경 여부 확인 (0) | 2019.12.22 |