ElasticSearch通过CURL创建索引

1.创建索引

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"settings":{"index":{"refresh_interval":"5s","number_of_shards":"1","analysis":{"analyzer":{"default":{"tokenizer":"ik_max_word"},"pinyin_analyzer":{"tokenizer":"my_pinyin"}},"tokenizer":{"my_pinyin":{"keep_joined_full_pinyin":"true","keep_none_chinese_in_first_letter":"true","lowercase":"true","none_chinese_pinyin_tokenize":"false","keep_none_chinese_in_joined_full_pinyin":"true","keep_first_letter":"false","type":"pinyin","keep_full_pinyin":"false"}}},"number_of_replicas":"1"}},"mappings":{"properties":{"assetType":{"type":"long"},"bizContent":{"type":"text","analyzer":"ik_max_word"},"bizId":{"type":"keyword"},"bizMeg":{"type":"text","fields":{"suggest":{"contexts":[{"name":"tenantName","type":"category","path":"tenantName"}],"type":"completion","analyzer":"ik_max_word","preserve_separators":true,"preserve_position_increments":true,"max_input_length":50}},"analyzer":"ik_max_word"},"bizName":{"type":"keyword"},"bizNameOrder":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"pinyin_analyzer","fielddata":true},"bizType":{"type":"integer"},"orgId":{"type":"integer"},"createTime":{"type":"date","format":"YYYY-MM-dd HH:mm:ss"},"dbSearchText":{"type":"keyword"},"dbdirId":{"type":"long"},"hot":{"type":"integer"},"id":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"metadirId":{"type":"integer"},"tenantName":{"type":"keyword"},"updateTime":{"type":"date","format":"YYYY-MM-dd HH:mm:ss"},"updateUser":{"type":"keyword"}}}}' 'http://127.0.0.1:9200/farer_index'

2.查看索引信息

curl -X GET http://127.0.0.1:9200/_cat/indices

3.其它_cat操作

/_cat/allocation 
/_cat/shards 
/_cat/shards/{index} 
/_cat/master 
/_cat/nodes 
/_cat/indices 
/_cat/indices/{index} 
/_cat/segments 
/_cat/segments/{index} 
/_cat/count 
/_cat/count/{index} 
/_cat/recovery 
/_cat/recovery/{index} 
/_cat/health 
/_cat/pending_tasks 
/_cat/aliases 
/_cat/aliases/{alias} 
/_cat/thread_pool 
/_cat/plugins 
/_cat/fielddata 
/_cat/fielddata/{fields} 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值