• 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总会解决,未来道路很光明。
  • 相关阅读:
    胡小兔的良心莫队教程:莫队、带修改莫队、树上莫队
    51nod 1290 Counting Diff Pairs | 莫队 树状数组
    Git的简单使用
    使用canvas制作五子棋游戏
    axios的Get和Post方法封装及Node后端接收数据
    mongodb初始化并使用node.js实现mongodb操作封装
    nodeJs实现微信小程序的图片上传
    CSS中text-shadow的几个好看的文字demo及其代码
    博客园自定义样式
    input输入框添加内部图标
  • 原文地址:https://www.cnblogs.com/dadadajiong/p/13177236.html
Copyright © 2020-2023  润新知