elasticsearch6.X 创建index,mapping操作

删除index mapping

curl -XDELETE “http://localhost:9200/owner”;
curl -XDELETE “localhost:9200/stealth”;
curl -XDELETE “http://localhost:9200/high_intention”;

创建mapping

index 车主

curl -XPUT “http://localhost:9200/owner”;

mapping

curl -H “Content-Type: application/json” -XPUT “http://localhost:9200/owner/_mapping/owner” -d ‘{“properties”:{“id”:{“type”:“long”,“store”:true},“name”:{“type”:“keyword”,“store”:true},“sex”:{“type”:“keyword”,“store”:true},“age”:{“type”:“integer”,“store”:true},“mobile”:{“type”:“keyword”,“store”:true},“vehicleType”:{“type”:“keyword”},“occupation”:{“type”:“keyword”,“store”:true},“userType”:{“type”:“keyword”,“store”:true},“vin”:{“type”:“keyword”,“store”:true},“address”:{“type”:“keyword”,“store”:true},“education”:{“type”:“keyword”,“store”:true},“familyStatus”:{“type”:“keyword”,“store”:true},“userOrigin”:{“type”:“keyword”,“store”:true},“income”:{“type”:“keyword”,“store”:true},“loanMode”:{“type”:“keyword”,“store”:true},“buyDate”:{“type”:“date”,“store”:true},“buyType”:{“type”:“keyword”,“store”:true}}}’

index 潜客

curl -XPUT “http://localhost:9200/stealth”;
#mapping
curl -H “Content-Type: application/json” -XPUT “http://localhost:9200/stealth/_mapping/stealth” -d ‘{“properties”:{“id”:{id"type":“long”,“store”:true},“name”:{姓名"type":“keyword”,“store”:true},“sex”:{性别"type":“integer”,“store”:true},“age”:{年龄"type":“integer”,“store”:true},“userType”:{用户类型"type":“keyword”,“store”:true},“occupation”:{职业"type":“keyword”,“store”:true},“address”:{省份地区"type":“keyword”,“store”:true},“education”:{学历"type":“keyword”,“store”:true},“mobile”:{手机号"type":“keyword”,“store”:true},“userOrigin”:{用户来源"type":“keyword”,“store”:true},“familyStatus”:{家庭状况"type":“keyword”,“store”:true},“followVehicleType”:{关注车型"type":“keyword”,“store”:true},“attemptCarType”:{有无试驾"type":“boolean”,“store”:true},“buyReason”:{购买原因"type":“keyword”,“store”:true},“carIntention”:{购车意向"type":“keyword”,“store”:true}}}’;

index 高意向

curl -XPUT “http://localhost:9200/high_intention”;

mapping

curl -H “Content-Type: application/json” -XPUT “http://localhost:9200/high_intention/_mapping/high_intention” -d ‘{“properties”:{“id”:{ID"type":“long”,“store”:true},“name”:{“type”:“keyword”,“store”:true},“sex”:{性别"type":“integer”,“store”:true},“age”:{年龄"type":“integer”,“store”:true},“userType”:{用户类型"type":“keyword”,“store”:true},“occupation”:{职业"type":“keyword”,“store”:true},“address”:{省份地区(居住地)“type”:“keyword”,“store”:true},“education”:{学历"type":“keyword”,“store”:true},“mobile”:{手机号"type":“keyword”,“store”:true},“userOrigin”:{用户来源"type":“keyword”,“store”:true},“familyStatus”:{家庭状况"type":“keyword”,“store”:true},“followVehicleType”:{意向车型"type":“keyword”,“store”:true},“attemptCarType”:{有无试驾"type":“keyword”,“store”:true},“buyReason”:{购买原因"type":“keyword”,“store”:true},“orderModel”:{是否下订单"type":“keyword”,“store”:true},“coupon”:{优惠券领取"type":“keyword”,“store”:true}}}’;

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值