1
ElasticSearchTemplate
을 사용하면 간단한 엔티티 클래스에서 색인을 쉽게 만들 수 있습니다.ElasticSearch Java API와 ElasticsearchTemplate
elasticsearchTemplate.createIndex(Book.class);
elasticsearchTemplate.putMapping(Book.class);
elasticsearchTemplate.refresh(Book.class);
이이 spring-data-elasticsearch
및 운영 문자열에없이 순수 ES 자바 API을 달성 할 수있다 (JSON)을 :
@Document(indexName = "bookshop", type = "book", shards = 2, replicas = 2, refreshInterval = "-1")
public class Book {
@Id
private String id;
@Field(type = FieldType.String, store = true)
private String title;
}
그것만큼 충분히 만들 : 나는 Book.java을 저장하고 싶은 말은 ?