es 建索引時指定分片資料和副本數
阿新 • • 發佈:2019-02-11
1指定分片數量 "number_of_shards":8
2指定副本數量 "number_of_replicas" : 1
3指定重新整理時間30s,寫入資料時,檢視到的資料與真實資料有30s的延時 "refresh_interval":"30s"
4禁用_all 欄位 "_all":{ "enabled": false}
curl -XDELETE 'http://'${es_node}':9200/index_name'${year_dt}''
curl -XPUT 'http://'${es_node}':9200/index_name'${year_dt}'?pretty' -H 'Content-Type: application/json' -d'{
"settings" : {
"number_of_shards":8,
"number_of_replicas" : 1,
"refresh_interval":"30s"
},
"mappings" : {
"type_name":{
"properties":{
"bill_code":{
"type":"string",
"index":"not_analyzed"
},
"opupk":{
"type":"string",
"index":"not_analyzed"
},
"invoice_code":{
"type":"string",
"index":"not_analyzed"
},
"customer_code":{
"type":"string",
"index":"not_analyzed"
},
"zone_code":{
"type":"string",
"index":"not_analyzed"
},
"vip_code":{
"type":"string",
"index":"not_analyzed"
},
"vip_zone_code":{
"type":"string",
"index":"not_analyzed"
},
"bukrs":{
"type":"string",
"index":"not_analyzed"
},
"bill_period":{
"type":"string",
"index":"not_analyzed"
},
"payment_term":{
"type":"string",
"index":"not_analyzed"
},
"payment_due_dt":{
"type":"string",
"index":"not_analyzed"
},
"vktyp":{
"type":"string",
"index":"not_analyzed"
},
"fee_amt1":{
"type":"string",
"index":"not_analyzed"
},
"currency_code1":{
"type":"string",
"index":"not_analyzed"
},
"fee_amt2":{
"type":"string",
"index":"not_analyzed"
},
"currency_code2":{
"type":"string",
"index":"not_analyzed"
},
"receipt_batch_number":{
"type":"string",
"index":"not_analyzed"
},
"bu_type":{
"type":"string",
"index":"not_analyzed"
},
"unique_id":{
"type":"string",
"index":"not_analyzed"
},
"bg_code":{
"type":"string",
"index":"not_analyzed"
},
"depart":{
"type":"string",
"index":"not_analyzed"
},
"charge_item_code":{
"type":"string",
"index":"not_analyzed"
},
"region_type_code":{
"type":"string",
"index":"not_analyzed"
},
"tax_rule_code":{
"type":"string",
"index":"not_analyzed"
},
"kostl":{
"type":"string",
"index":"not_analyzed"
},
"geber":{
"type":"string",
"index":"not_analyzed"
},
"partner_zone_code":{
"type":"string",
"index":"not_analyzed"
},
"partner_bg_code":{
"type":"string",
"index":"not_analyzed"
},
"partner_bukrs":{
"type":"string",
"index":"not_analyzed"
},
"original_gl_dt":{
"type":"string",
"index":"not_analyzed"
},
"zzcustom_01":{
"type":"string",
"index":"not_analyzed"
},
"zzcustom_02":{
"type":"string",
"index":"not_analyzed"
},
"zzcustom_03":{
"type":"string",
"index":"not_analyzed"
},
"zzcustom_04":{
"type":"string",
"index":"not_analyzed"
},
"zzcustom_05":{
"type":"string",
"index":"not_analyzed"
},
"batch_no":{
"type":"string",
"index":"not_analyzed"
},
"caculate_dt":{
"type":"string",
"index":"not_analyzed"
},
"rebate_begin_dt":{
"type":"string",
"index":"not_analyzed"
},
"rebate_end_dt":{
"type":"string",
"index":"not_analyzed"
},
"bill_end_inv_flg":{
"type":"string",
"index":"not_analyzed"
},
"invoice_type":{
"type":"string",
"index":"not_analyzed"
},
"create_tm":{
"type":"string",
"index":"not_analyzed"
}
},
"_all":{ "enabled": false}
}
}
}';