1.建立索引
PUT /index_trans_detail
2.建立mapping
POST /index_trans_detail/type_trans_detail/_mapping
{
"type_trans_detail": {
"properties": {
"id": {
"type": "long"
},
"entId": {
"type": "long"
},
"orgId": {
"type": "long"
},
"seqno": {
"type": "text",
"fielddata": true
},
"transDate": {
"type": "date",
"format": "yyyy-MM-dd"
},
"postTatus": {
"type": "integer"
},
"ioFlag": {
"type": "integer"
},
"depotId": {
"type": "long"
},
"depotCode": {
"type": "keyword"
},
"depotName": {
"type": "text"
},
"depotClassId": {
"type": "long"
},
"depotClassCode": {
"type": "keyword"
},
"depotClassName": {
"type": "text"
},
"orgOrgId": {
"type": "long"
},
"orgOrgCode": {
"type": "keyword"
},
"orgOrgName": {
"type": "text"
},
"orgOrgClassId": {
"type": "long"
},
"orgOrgClassCode": {
"type": "keyword"
},
"orgOrgClassName": {
"type": "text"
},
"balOrgId": {
"type": "long"
},
"balOrgCode": {
"type": "keyword"
},
"balOrgName": {
"type": "text"
},
"transOrgId": {
"type": "long"
},
"transOrgCode": {
"type": "keyword"
},
"transOrgName": {
"type": "text"
},
"transOrgClassId": {
"type": "long"
},
"transOrgClassCode": {
"type": "keyword"
},
"transOrgClassName": {
"type": "text"
},
"transBalOrgId": {
"type": "long"
},
"transBalOrgCode": {
"type": "keyword"
},
"transBalOrgName": {
"type": "text"
},
"transTypeId": {
"type": "long"
},
"transType": {
"type": "keyword"
},
"transName": {
"type": "text"
},
"dutyBillId": {
"type": "long"
},
"dutyBillType": {
"type": "integer"
},
"dutyBillNo": {
"type": "text",
"fielddata": true
},
"sourceId": {
"type": "long"
},
"sourceType": {
"type": "integer"
},
"sourceNo": {
"type": "keyword"
},
"billStatus": {
"type": "integer"
},
"headRemark": {
"type": "text"
},
"isAllowDel": {
"type": "integer"
},
"useOrgId": {
"type": "long"
},
"headIoQty": {
"type": "double"
},
"headIoAmt": {
"type": "double"
},
"headIoCostAmt": {
"type": "double"
},
"periodNo": {
"type": "text"
},
"externalBillNo": {
"type": "text"
},
"externalSysType": {
"type": "integer"
},
"useDepId": {
"type": "long"
},
"useDepCode": {
"type": "keyword"
},
"useDepName": {
"type": "text"
},
"usePurpose": {
"type": "integer"
},
"transId": {
"type": "long"
},
"goodsId": {
"type": "long"
},
"goodsCode": {
"type": "keyword"
},
"goodsName": {
"type": "text"
},
"goodsClassId": {
"type": "long"
},
"goodsClassCode": {
"type": "keyword"
},
"goodsClassName": {
"type": "text"
},
"goodsSpec": {
"type": "keyword"
},
"goodsOrigin": {
"type": "text"
},
"postFlag": {
"type": "integer"
},
"goodsWeight": {
"type": "double"
},
"ioQty": {
"type": "double"
},
"ioPrice": {
"type": "double"
},
"ioAmt": {
"type": "double"
},
"unitId": {
"type": "long"
},
"unitName": {
"type": "text"
},
"unitRate": {
"type": "double"
},
"iocostPrice": {
"type": "double"
},
"ioCostAmt": {
"type": "long"
},
"feeAmt": {
"type": "long"
},
"lotId": {
"type": "long"
},
"dutyBillDetailId": {
"type": "long"
},
"sourceDetailId": {
"type": "long"
},
"dutyOrgId": {
"type": "long"
},
"postUserId": {
"type": "long"
},
"postDateTime": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"postReturnId": {
"type": "long"
},
"errMsg": {
"type": "text"
},
"firstPostDatetime": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"balanceFlag": {
"type": "integer"
},
"remark": {
"type": "text"
},
"baseQty": {
"type": "double"
},
"baseUnitId": {
"type": "long"
},
"baseUnitName": {
"type": "text"
},
"baseUnitPrice": {
"type": "double"
},
"createType": {
"type": "integer"
},
"createHeadId": {
"type": "long"
},
"invUnitId": {
"type": "long"
},
"invUnitCode": {
"type": "keyword"
},
"invUnitName": {
"type": "text"
},
"invUnitRate": {
"type": "double"
},
"invQty": {
"type": "double"
},
"invCostPrice": {
"type": "double"
},
"discountRate": {
"type": "double"
},
"discountTaxRate": {
"type": "double"
},
"taxRate": {
"type": "double"
},
"taxAmt": {
"type": "double"
},
"ioBillStatus": {
"type": "integer"
},
"ioBillTime": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"ioBillQty": {
"type": "double"
},
"taxType": {
"type": "integer"
},
"isStoBackPrice": {
"type": "integer"
},
"stoCostPrice": {
"type": "double"
},
"stoCostAmt": {
"type": "double"
},
"version": {
"type": "integer"
},
"deleted": {
"type": "long"
},
"creatorCode": {
"type": "keyword"
},
"creatorName": {
"type": "text",
"fielddata": true
},
"createdAt": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"creatorOrgCode": {
"type": "keyword",
"index": false
},
"modifierCode": {
"type": "keyword",
"index": false
},
"modifierName": {
"type": "text"
},
"lastModifiedAt": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"modifierOrgCode": {
"type": "keyword",
"index": false
},
"invTransHeadId": {
"type": "long"
},
"handledOrgCode": {
"type": "keyword"
},
"handledOrgName": {
"type": "text"
},
"createdAtTimestamp": {
"type": "date",
"format": "epoch_millis"
},
"transDateTimestamp": {
"type": "date",
"format": "epoch_millis"
},
"lastModifiedTimestamp": {
"type": "date",
"format": "epoch_millis"
},
"postDateTimeTimestamp": {
"type": "date",
"format": "epoch_millis"
},
"ioBillTimeTimestamp": {
"type": "date",
"format": "epoch_millis"
},
"firstPostDatetimeTimestamp": {
"type": "date",
"format": "epoch_millis"
}
}
}
}
3.建立别名
PUT /index_trans_detail/_alias/index_trans_detail_alias