导航菜单

索引构建

索引基础

  • • 索引的定义与作用
  • • 索引的基本组成
  • • 索引的工作流程

Elasticsearch索引示例

# 创建索引
PUT /my_index
{
  "mappings": {
    "properties": {
      "title": { "type": "text" },
      "content": { "type": "text" }
    }
  }
}

# 添加文档
POST /my_index/_doc
{
  "title": "示例标题",
  "content": "示例内容"
}