浏览代码

es mapping

jkzlzhoujie 6 年之前
父节点
当前提交
abcbfb218a
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      src/main/java/com/yihu/quota/util/ElasticSearchHandler.java

+ 1 - 5
src/main/java/com/yihu/quota/util/ElasticSearchHandler.java

@ -169,13 +169,11 @@ public class ElasticSearchHandler {
                        mapping.startObject(field).field("type", "string").field("index", "not_analyzed").endObject();
                    }else if(participle == 2) {
                        mapping.startObject(field).field("type", "string").endObject();
                    }else {
                        mapping.startObject(field).field("type", "keyword").field("index", "not_analyzed").endObject();
                    }
                }else if("date".equals(dataType)){
                    mapping.startObject(field).field("type", dataType).field("format", "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis").endObject();
                }else if("nested".equals(dataType)){//子集属性
                    mapping.startObject(field).startObject("properties");
                    mapping.startObject(field).field("type", "nested").startObject("properties");
                    //子属性
                    List<FieldInfo> childFieldList = info.getFieldInfos();
                    for(FieldInfo child : childFieldList){
@ -187,8 +185,6 @@ public class ElasticSearchHandler {
                                mapping.startObject(childField).field("type", "string").field("index", "not_analyzed").endObject();
                            }else if(childParticiple == 2) {
                                mapping.startObject(childField).field("type", "string").endObject();
                            }else {
                                mapping.startObject(childField).field("type", "keyword").field("index", "not_analyzed").endObject();
                            }
                        }else if("date".equals(dataType)){
                            mapping.startObject(childField).field("type", childDataType).field("format", "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis").endObject();