프로그래밍/ElasticSearch
(ElasticSearch) JEST Index 생성 방법 (Index Create)
rlawlstjd007
2020. 5. 23. 11:27
들어가며
- JEST를 사용하여 Elastics Search DB 서버에 특정 Index를 생성하는 방법에 대해서 알아보도록 하겠습니다.
실행환경
- ElasticSeacrh (V5.5.1)
구현방법
CreateIndex
클래스를 이용하여 원하는 Index 명으로 Index를 생성해줍니다.
//DB Server 주소 String elasticAddress = "http://localhost:9200"; //Index 명 String indexName = ""; JestClientFactory factory = new JestClientFactory(); final HttpClientConfig.Builder builder = new HttpClientConfig.Builder(elasticAddress) .gson(new Gson()) .connTimeout(1000 * 30) .readTimeout(1000 * 60 * 5) .multiThreaded(true); factory.setHttpClientConfig(builder.build()); this.client = factory.getObject(); try { client.execute(new CreateIndex.Builder(getIndexName()).build()); } catch (IOException e) { System.out.println("Failed to create DB Index. Name: " + indexName); }
관련글
(ElasticSearch) ElasticSearch 프론트엔드 플러그인 elasticsearch-head 설치 및 사용법
elasticsearch-head ElasticSearch DB 정보 및 쿼리를 Front End 페이지를 통해서 조작할 수 있는 플러그인이다. 아래와 같이 생겼으며 Index리스트 및 상세 정보, Query 입력창 등을 이용할 수 있다. 설치방법..
jinseongsoft.tistory.com
[ElasticSearch] 1. ElasticSearch의 개요
1. ElasticSearch의 개요 "Search is something that any application should have" - Shay Banon (Creator of ElasticSearch) 1.1 History of ElasticSearch 2004년, Shay Banon이 Compass 라는 제품 개발을 했고..
jinseongsoft.tistory.com
반응형