• es手动创建索引,修改索引,删除索引


    1、创建索引

    创建索引的语法
    PUT /my_index
    {
      "settings": { ... any settings ... },
      "mappings": {
        "type_one": { ... any mappings ... },
        "type_two": { ... any mappings ... },
        ...
      }
    }

    创建索引的示例
    PUT /my_index
    {
      "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 0
      },
      "mappings": {
        "my_type": {
          "properties": {
            "my_field": {
              "type": "text"
            }
          }
        }
      }
    }

    2、修改索引
    PUT /my_index/_settings
    {
      "number_of_replicas": 1
    }

    3、删除索引
    DELETE /my_index
    DELETE /index_one,index_two
    DELETE /index_*
    DELETE /_all

    可以设置下面的属性,使DELETE /_all 失效,必须指定索引名称,才可以删除。
    elasticsearch.yml
    action.destructive_requires_name: true

  • 相关阅读:
    开更
    PKUSC2016
    Educational Codeforces Round 12 E Beautiful Subarrays
    省选过了,又开始更新了。。。
    我来试试视频功能
    [BZOJ4407]于神之怒加强版
    bzoj3998: [TJOI2015]弦论
    bzoj4569: [Scoi2016]萌萌哒
    2016-5-30模拟测试
    2016-5-26模拟测试
  • 原文地址:https://www.cnblogs.com/qinjf/p/8536608.html
Copyright © 2020-2023  润新知