Advertisement

Elasticsearch indexing

阅读量:

1. 基本概念

索引集(indices, index的复数):完整的逻辑层次结构collection1
分片(shard):各个数据分区
副本(replica):每个shard对应的副本 copies

<<Elasticsearch: 官方技术参考>> 是一本权威的技术手册

图画理解Elasticsearch:https://developer.51cto.com/art/201904/594615.htm

2, 创建索引
Elasticsearch基于Rest风格API设计, 因此在创建索引时, 可以理解为只需发送一次HTTP 请求. 任何工具都可以用来发送HTTP 请求来建立索引.

请求方法:PUT
指定路径:/索引库名
发送数据格式:以JSON格式传输

{
[
"settings": {
"shard数量":1, //分片
"replica数量":0 //副本
}
]
}

例:

复制代码
 PUT /hh

    
 {
    
   "settings": {
    
     "number_of_shards":1,
    
     "number_of_replicas":0
    
   }
    
 }

![](https://cdl.itadn.co

全部评论 (0)

还没有任何评论哟~