ElasticSearch 设置索引mapping 文档类型

   设置文档类型要在新建一个索引的时候设置。我的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": "1",    //备份节点(如果只有一台测试机器设置成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"
			}
		}
	}
}‘ 

  


curl -XPUT ‘elastic:GUIJIAOpass6L83af6J@192.168.1.16:9200/three_goods_index‘ -H ‘Content-Type: application/json‘ -d ‘{"settings": {"number_of_shards": "1","number_of_replicas": "1","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"},"disabled": {"type": "keyword"},"notify_num": {"type": "long"},"store": {"type": "double"},"store_freeze": {"type": "double"},"uptime": {"type": "long"},"downtime": {"type": "long"},"last_modify": {"type": "long"},"p_order": {"type": "long"},"d_order": {"type": "long"},"price": {"type": "double"},"score": {"type": "double"},"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"},"small_pic": {"type": "text"},"big_pic": {"type": "text"},"intro": {"type": "text","analyzer": "ik_smart"},"appintro": {"type": "text","analyzer": "ik_smart"},"store_place": {"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"},"params": {"type": "text"},"spec_desc": {"type": "text"},"rank_count": {"type": "long"},"comments_count": {"type": "long"},"view_w_count": {"type": "long"},"view_count": {"type": "long"},"buy_count": {"type": "long"},"buy_w_count": {"type": "long"},"count_stat": {"type": "text"},"store_id": {"type": "long"},"goods_state": {"type": "keyword"},"buy_m_count": {"type": "long"},"view_m_count": {"type": "long"},"fav_count": {"type": "long"},
"freight_bear": {"type": "keyword"},"marketable_allow": {"type": "keyword"},"verify": {"type": "keyword"},"verify_remark": {"type": "text"},"marketable_content": {"type": "text"},"act_type": {"type": "text"},"productArea": {"type": "text","analyzer": "ik_smart"},"goods_kind": {"type": "keyword"},"upc": {"type": "text","analyzer": "ik_smart"},"saleUnit": {"type": "text","analyzer": "ik_smart"},"wareQD": {"type": "text"
},"tax": {"type": "double"},"tax_price": {"type": "double"},"avg_point": {"type": "double"},"goods_order_down": {"type": "long"}}}}‘ 

ElasticSearch 设置索引mapping 文档类型

上一篇:Android手机获取系统rom的定制商


下一篇:java 发送手机验证码,阿里云