Skip to content

Elasticsearch 使用指南

Elasticsearch(ES)是一个分布式、RESTful 的搜索和分析引擎。

文档目录

文档说明
数据类型与 Mapping字段类型、Mapping 写法、完整示例
索引库 CRUD创建/查看/修改/删除索引、别名、模板
文档 CRUD添加/查询/更新/删除文档、Bulk 批量操作
Spring Boot 集成 ESElasticsearchRestTemplate / RestHighLevelClient API 详解

核心概念

概念说明类比(关系型)
Index(索引)文档集合Database
Mapping(映射)字段类型定义Schema
Document(文档)JSON 数据Row
Field(字段)属性Column
Shard(分片)数据分片分区
Replica(副本)冗余副本从库

Spring Boot 集成

xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
yaml
spring:
  elasticsearch:
    rest:
      uris: http://localhost:9200
      connection-timeout: 5s
      read-timeout: 30s
最近更新