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总会解决,未来道路很光明。
  • 相关阅读:
    Leetcode 650
    Leetcode 292
    Leetcode 162
    Leetcode 600
    Leetcode 1894
    知识库
    Win2012R2(英文版)开放远程用户登录数量限制的设置
    Win2012R2(英文版)多账号登录,报错:Select a user to disconnect so that you can sign in的处理
    webstorm修改默认浏览器方法
    处理Chrome等浏览器无法上网,但微信能正常使用问题
  • 原文地址:https://www.cnblogs.com/dadadajiong/p/13177236.html
Copyright © 2011-2022 走看看