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":{"defaul
·
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条内容
所有评论(0)