如何通过JAVA API创建映射期间在Elasticsearch中添加日期格式

时间:2018-09-18 19:19:59

标签: elasticsearch

我正在使用:

createResponce = client.admin().indices().prepareCreate("raw_cluster_pk")
                        .addMapping("btas_pk",                          
                                "CDR_Generation_Number", "type=long",               
                                "CDR_Version_Number", "type=string",
                                "Call_Initiation_Time", "type=date",/*"dateFormat=MMddyyyyHHmmssSSS"*/).get();

获取数据:

{
                "fieldNames": [{
                                "fieldname": "CDR_Generation_Number",
                                "fieldtype": "long"
                }, {
                                "fieldname": "CDR_Version_Number",
                                "fieldtype": "string"
                }, {
                                "fieldname": "Call_Initiation_Time",
                                "dateFormat": "MMddyyyyHHmmssSSS",
                                "fieldtype": "date"

                }]
}

所以我需要建议如何在类似于类型的java代码中添加dateFormat?

0 个答案:

没有答案