zoukankan      html  css  js  c++  java
  • es学习-索引管理

    1.创建索引

    http://localhost:9200/suoyinguanli211/

    参数:

    {
       "settings":{
          "index":{
              "number_of_shards":3,分片数
              "number_of_replicas":2 副本数
         }
      }
    }

    结果如图

    修改索引信息

     url:http://localhost:9200/suoyinguanli211/_settings/

    参数:

    {
    "number_of_replicas":1
    }

    结果:

    定义映射类型:

    url:http://localhost:9200/suoyinguanli211-1/

    参数:

    {
    	"settings": {
    		"index": {
    			"number_of_shards": 3,
    			"number_of_replicas": 1
    		},
    		"mapping": {
    			"secilog": {
    				"properties": {
    					"name": {
    						"type": "string",
    						"index": "not_analyzed"
    					},
    					"name2": {
    						"type": "string",
    						"index": "analyzed"
    					}
    				}
    			}
    		}
    	}
    }
    

      

    结果:

    删除索引:

    url :delete http://localhost:9200/suoyinguanli211-1/

    获取索引:

     也可以指定输出的内容:http://localhost:9200/suoyinguanli211/_mapping,_settings/

    结果:

          

    {
    	"suoyinguanli211": {
    		"mappings": {},
    		"settings": {
    			"index": {
    				"creation_date": "1532779519842",
    				"number_of_shards": "3",
    				"number_of_replicas": "1",
    				"uuid": "E4vDOCwSQVKY_wN17QXVaQ",
    				"version": {
    					"created": "2040099"
    				}
    			}
    		}
    	}
    }
    

      

  • 相关阅读:
    ideaIU-2017.1.1.exe安装、注册、汉化IntelliJ IDEA
    504 Gateway Timeout 异常
    Windows下80端口被进程System占用的解决方法
    D2Admin基本使用
    MySQL 教程
    Element 插件
    VSCode-Element-Helper
    ECharts 教程
    JSP 教程
    Kotlin 教程 Android 官方开发语言
  • 原文地址:https://www.cnblogs.com/anxbb/p/9383354.html
Copyright © 2011-2022 走看看