zoukankan      html  css  js  c++  java
  • ElasticSearch 设置索引mapping 文档类型,重置elastic密码

       设置文档类型要在新建一个索引的时候设置。我的elastic是7.6.2

       
    curl -XPUT 'elastic:123456@192.168.1.16:9200/index_v1' -H 'Content-Type: application/json' -d '{
    	"settings": {
    		"number_of_shards": "1",     //分片
    		"number_of_replicas": "0",    //备份节点(如果只有一台测试机器设置成0)
    		"max_result_window": "1000000"
    	},
    	"mappings": {
    		"properties": {
    			"goods_id": {
    				"type": "long"
    			},
    			"bn": {
    				"type": "keyword"
    			},
    			"name": {
    				"type": "text",
    				"analyzer": "ik_smart"
    			},
    			"name_max_word": {
    				"type": "text",
    				"analyzer": "ik_max_word"
    			},
    			"name_full": {
    				"type": "keyword"
    			},
    			"unit": {
    				"type": "keyword"
    			},
    			"brief": {
    				"type": "text",
    				"analyzer": "ik_smart"
    			},
    			"marketable": {
    				"type": "keyword"
    			},
    			"image_default_id": {
    				"type": "keyword"
    			},
    			"type_id": {
    				"type": "long"
    			},
    			"cat_id": {
    				"type": "long"
    			},
    			"brand_id": {
    				"type": "long"
    			},
    			"cat_name": {
    				"type": "keyword"
    			},
    			"brand_name": {
    				"type": "keyword"
    			},
    			"goods_type": {
    				"type": "keyword"
    			},
    			"mktprice": {
    				"type": "double"
    			},
    			"weight": {
    				"type": "double"
    			},
    			"rate": {
    				"type": "double"
    			},
    			"cost": {
    				"type": "double"
    			},
    			"udfimg": {
    				"type": "keyword"
    			},
    			"min_buy": {
    				"type": "long"
    			},
    			"max_buy": {
    				"type": "long"
    			},
    			"thumbnail_pic": {
    				"type": "text"
    			},
    			"package_unit": {
    				"type": "text",
    				"analyzer": "ik_smart"
    			},
    			"package_scale": {
    				"type": "double"
    			},
    			"package_use": {
    				"type": "keyword"
    			},
    			"score_setting": {
    				"type": "keyword"
    			},
    			"nostore_sell": {
    				"type": "keyword"
    			},
    			"goods_setting": {
    				"type": "text"
    			}
    		}
    	}
    }' 
    

     在记得原密码的情况下:重置elastic密码:123456

    curl -H "Content-Type:application/json" -XPOST -u elastic 'http://127.0.0.1:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'
    

      



    -- 沉着,冷静,bug总会解决,未来道路很光明。
  • 相关阅读:
    css属性操作2(外边距与内边距<盒子模型>)
    css的属性操作1
    css伪类
    属性选择器二
    属性选择器1
    03_MySQL重置root密码
    02_Mysql用户管理之Navicat下载及安装
    18.扩散模型
    17.广播模型
    16.友谊悖论
  • 原文地址:https://www.cnblogs.com/dadadajiong/p/13177236.html
Copyright © 2011-2022 走看看