一、学习目标
- 掌握ES索引的创建与删除
- 理解Mapping(映射)的作用与配置方式
- 学会查看索引信息与设置
- 了解索引别名的使用方法
二、操作步骤
步骤1:创建索引(带Mapping)
创建一个名为 books 的索引,并定义字段类型映射:
curl -X PUT \”localhost:9200/books\” -H \’Content-Type: application/json\’ -d\’
{
\”settings\”: {
\”number_of_shards\”: 1,
\”number_of_replicas\”: 0
},
\”mappings\”: {
\”properties\”: {
\”title\”: { \”type\”: \”text\”, \”analyzer\”: \”standard\” },
\”auth



![[特殊字符]DeepSeek‑Harness(DSH)小白保姆教程-171主机测评](https://www.171host.com/wp-content/uploads/2026/08/20260816085112-6a817a009aabf-220x150.png)