Elasticsearch如何设置mapping

本文介绍了如何使用curl命令新建Elasticsearch索引,并详细展示了设置复杂mapping的方法,包括多种字段类型的定义及其特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 新建索引
    curl -XPOST "http://********/rdx_index_test"

  • 查看mapping
    curl -XGET "http://********/rdx_index_test/_mapping?pretty"

  • 设置mapping
    curl -XPOST "http://********/rdx_index_test/rdx_type/_mapping?pretty" -d '{
    "rdx_type": {
    "properties": {
    "chuangjianzhe_id": {
    "type": "string"
    },
    "zy_created_at": {
    "type": "long"
    },
    "zy_shifou_gongyingshang": {
    "type": "string"
    },
    "zy_zuzhi_leixing": {
    "index": "not_analyzed",
    "type": "string"
    },
    "invalid_email": {
    "type": "string"
    },
    "twitter": {
    "type": "string"
    },
    "zy_contacts": {
    "include_in_parent": true,
    "type": "nested",
    "properties": {
    "uid": {
    "include_in_all": false,
    "type": "string"
    },
    "id": {
    "include_in_all": false,
    "type": "integer"
    },
    "time": {
    "include_in_all": false,
    "type": "integer"
    },
    "content": {
    "type": "string"
    }
    }
    },
    "zy_leixing": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_jianli_url": {
    "type": "string"
    },
    "import_es": {
    "type": "long"
    },
    "zy_creator": {
    "properties": {
    "uid": {
    "include_in_all": false,
    "type": "string"
    },
    "time": {
    "include_in_all": false,
    "type": "integer"
    }
    }
    },
    "zy_jiaoyujingli": {
    "type": "string"
    },
    "zy_lianxiren": {
    "type": "string"
    },
    "zy_phone_status": {
    "type": "integer"
    },
    "id": {
    "type": "long"
    },
    "zy_tlevel": {
    "type": "string"
    },
    "zy_yaoqiu_jiage": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_idcard_type": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_nickname": {
    "type": "string"
    },
    "zy_shanchanghangye": {
    "type": "string"
    },
    "zy_gongsi_mingcheng": {
    "type": "string"
    },
    "zy_shanchangyuzhong": {
    "type": "string"
    },
    "shanchanghangye": {
    "type": "string"
    },
    "zy_weixin": {
    "type": "string"
    },
    "ch_fanyi_leixing": {
    "type": "string"
    },
    "zy_mingzi": {
    "type": "string"
    },
    "zy_jiage_zhongwai": {
    "index": "not_analyzed",
    "type": "string"
    },
    "phone": {
    "type": "string"
    },
    "xm_background": {
    "type": "string"
    },
    "zy_graduate": {
    "type": "string"
    },
    "zy_yueding_jiage": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_qudao": {
    "type": "string"
    },
    "zy_zuihoudengluip": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_remark": {
    "type": "string"
    },
    "zy_ceshi_endtime": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_youxiang": {
    "type": "string"
    },
    "created_at": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_zizhi": {
    "type": "string"
    },
    "zy_chuanzhen": {
    "type": "string"
    },
    "skype": {
    "type": "string"
    },
    "zy_laiyuan": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_lingyu": {
    "type": "string"
    },
    "updated_at": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_edits": {
    "include_in_parent": true,
    "type": "nested",
    "properties": {
    "uid": {
    "include_in_all": false,
    "type": "string"
    },
    "time": {
    "include_in_all": false,
    "type": "integer"
    }
    }
    },
    "iolid": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_zhanghu": {
    "type": "string"
    },
    "zy_jiesuan_leixing": {
    "type": "string"
    },
    "zy_pingjia": {
    "type": "string"
    },
    "email": {
    "type": "string"
    },
    "zy_zhuangtai": {
    "type": "string"
    },
    "zy_ontime_rate": {
    "type": "string"
    },
    "facebook": {
    "type": "string"
    },
    "zy_shanchangkouyifangxiang": {
    "type": "string"
    },
    "zy_xingbie": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_xueke": {
    "type": "string"
    },
    "zy_jiage_waizhong": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_currency": {
    "type": "string"
    },
    "zy_return_rate": {
    "type": "string"
    },
    "nl_comment": {
    "type": "string"
    },
    "zy_shanchangbiyifangxiang": {
    "type": "string"
    },
    "zy_fanyileixing": {
    "type": "string"
    },
    "zy_xueli": {
    "type": "string"
    },
    "sync_time": {
    "type": "long"
    },
    "zy_hzcishu": {
    "type": "integer"
    },
    "mysql_has": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_msn": {
    "type": "string"
    },
    "is_operated": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_youbian": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_zhengshu_url": {
    "type": "string"
    },
    "zy_renwu_pingjia": {
    "type": "string"
    },
    "fanyileixing": {
    "type": "string"
    },
    "zy_shanchangzhuanye": {
    "type": "string"
    },
    "zy_hezuo_zishu": {
    "type": "integer"
    },
    "zy_gongzuo_shijian": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_dizhi": {
    "type": "string"
    },
    "zy_yingwenming": {
    "type": "string"
    },
    "zy_sheng": {
    "type": "string"
    },
    "xueke": {
    "type": "string"
    },
    "zy_qishinian": {
    "type": "long"
    },
    "zy_yuzhongfangxiang": {
    "type": "string"
    },
    "zy_status": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_ceshi_leixing": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_fanyi_leixing": {
    "type": "string"
    },
    "whatsapp": {
    "type": "string"
    },
    "zy_guojia": {
    "type": "string"
    },
    "zy_dianhua": {
    "type": "string"
    },
    "zy_shangji_id": {
    "type": "string"
    },
    "zy_qq": {
    "type": "string"
    },
    "ch_yuzhongfangxiang": {
    "type": "string"
    },
    "is_deleted": {
    "type": "long"
    },
    "zy_gongzuoshijian": {
    "type": "string"
    },
    "zy_yuyan": {
    "type": "string"
    },
    "zy_beiyong_youxiang": {
    "type": "string"
    },
    "zy_shouji": {
    "type": "string"
    },
    "zy_img_url": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_yiyuan_dengji": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_work_country": {
    "type": "string"
    },
    "zy_jingli": {
    "type": "string"
    },
    "zy_created_by": {
    "type": "string"
    },
    "interview_comment": {
    "type": "string"
    },
    "zy_shengri": {
    "type": "string"
    },
    "zy_month_amount": {
    "type": "string"
    },
    "zy_tests": {
    "include_in_parent": true,
    "type": "nested",
    "properties": {
    "uid": {
    "include_in_all": false,
    "type": "string"
    },
    "time": {
    "include_in_all": false,
    "type": "integer"
    }
    }
    },
    "zy_id": {
    "type": "string"
    },
    "zy_chengshi": {
    "type": "string"
    },
    "zy_jiage_qujian": {
    "index": "not_analyzed",
    "type": "string"
    },
    "nl_fanyi_leixing": {
    "index": "not_analyzed",
    "type": "string"
    },
    "zy_idcard": {
    "type": "string"
    }
    }
    }
    }'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值