当前位置:   article > 正文

一、ES索引基础命令_搜索es索引命令是什么

搜索es索引命令是什么

概括

Elaticsearch,简称为 ES, ES 是一个开源的高扩展的分布式[全文搜索]引擎,Elasticsearch 是面向数据库,一条数据在这里就是一个文档。

基本要素

ES是一个文档型数据库,下面将ES里面涉及到的元素与关系型数据库进行一一对应。

ElasticSearch索引(index)类型(type)文档(document)字段(field)
MySQL数据库(database)数据表(table)数据行(row)数据列(column)

索引操作

创建索引(没有mapping)

PUT /student
  • 1

创建索引(明确mapping),有使用分词器

GET /student
{
  "mappings": {
    "properties": {
      "info": {
        "type": "text",
        "analyzer": "ik_smart"
      },
      "email": {
        "type": "keyword",
        "index": false
      },
      "name": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "keyword",
            "index": false
          },
          "lastName": {
            "type": "keyword",
            "index": false
          }
        }
      }
    }
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

查看所有

GET /student
  • 1

查看所有索引

GET /_cat/indices
  • 1

删除索引

DELETE /student
  • 1

修改索引

PUT /student/_mapping
{
  "properties": {
    "age": {
      "type": "integer"
    }
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/825940
推荐阅读
相关标签
  

闽ICP备14008679号