본문 바로가기

Elasticsearch

[delete_by_query] 쿼리 & 삭제 무슨 플러그인을 깔아야 한다고 하던데 그건 2.X 버전에서만 그런가보다... 5.0.1 기준으로 플러그인 없이 순식간에 삭제가 되는걸 볼 수 있다. curl -POST '112.293.59.20:9200/myindex/mytype/_delete_by_query?pretty' -d '{ "query": { "match": { "name": "Kim" } }}' 더보기
[Elasticsearch] 스케일 아웃 #노드 해체하기 curl -XPUT 'localhost:9200/_cluster/settings' -d '{"transient" : {"cluster.routing.allocation.exclude._ip" : "192.168.1.10"}}' - 재시작을 원하는 노드를 그냥 종료하면 데이터의 손실이다. 위와같이 하면 (192.168.1.10은 해당 노드의 ip) 노드의 데이터들을 다른 노드들이 나눠가지면서 클러스터 green 상태를 유지하면서 재시작이 가능하다. ### 일반적으로 루씬 색인은 21억건 이상의 문서 혹은 2740억건 이상의 고유 텀들을 가질 수 없다. (p410) #롤링 리스타트 - 노드 업그레이드 혹은 설정값을 바꿀 때, 데이터 가용성을 해치지 않으면서 재구동을 하는 방법이다. 과정은 다.. 더보기
[Elasticsearch] Elasticsearch In Action - 5 5.3 분석 API로 텍스트 분석하기 #settings #analyzer #tokenizer #mapping curl -XPOST 'localhost:9200/myindex?pretty' -d '{ "settings" : {"number_of_shards" : 2,"number_of_replicas" : 1,"index" : {"analysis" : {"analyzer" : {"myCustomAnalyzer" : {"type" : "custom","tokenizer" : "myCustomTokenizer","filter" : ["myCustomFilter1", "myCustomFilter2"],"char_filter" : ["myCustomCharFilter"]}},"tokenizer" : {"myCus.. 더보기
[Elasticsearch] Elasticsearch In Action - 3,4 3.3 배열과 다중 필드 3.3.1 배열 curl -XPUT 'localhost:9200/blog/posts/1' -d ' {"tags" : ["first", "initial"]}'# 배열 필드는 mapping에서 정의하지 않아도 된다. (알아서 해준다) 3.3.2 다중 필드 curl -XPUT 'localhost:9200/blog/_mapping/posts' -d '{"posts" : {"properties" : {"tags" : {"type" : "string","index" : "analyzed","filed" : {"verbatim" : {"type" : "string","index" : "not_analyzed"}}}}}}'# 문자열을 위한 다중 필드: 한 번은 analyzed, 다은 한 번은 .. 더보기
[Elasticsearch] head plugin 설치 $ bin/plugin install mobz/elasticsearch-head 웹상에서의 확인 http://localhost:9200/_plugin/head/ 더보기