|
@@ -213,11 +213,9 @@ func NewAnalyTask(_id, s_mgourl, s_mgodb, s_coll string, i_poolsize int) (res bo
|
|
func NewClassificationRun(tt *TTask, tmp map[string]interface{}) *tools.SortMap {
|
|
func NewClassificationRun(tt *TTask, tmp map[string]interface{}) *tools.SortMap {
|
|
SMap := tools.NewSortMap()
|
|
SMap := tools.NewSortMap()
|
|
//tmpSavefield := map[string]interface{}{}
|
|
//tmpSavefield := map[string]interface{}{}
|
|
- fflag := map[string][]string{} //标志父类从属关系
|
|
|
|
- rulval := map[string]string{} //存储过滤记录
|
|
|
|
- class := tt.Class //获取任务中的多个分类
|
|
|
|
- topMap := make(map[string]string) //用来存储,表示一级是否有数据,为了解决不设置一级默认值,直接设置二级默认值导致没有一级有二级默认值
|
|
|
|
- // topMap["top"]= "toptype"
|
|
|
|
|
|
+ fflag := map[string][]string{} //标志父类从属关系
|
|
|
|
+ rulval := map[string]string{} //存储过滤记录
|
|
|
|
+ class := tt.Class //获取任务中的多个分类
|
|
if class != nil && len(class) > 0 {
|
|
if class != nil && len(class) > 0 {
|
|
/**
|
|
/**
|
|
一级分类匹配到title,二级标题分类成功匹配到招标或者竞谈,并且detail中含有合同金额等其他字段,
|
|
一级分类匹配到title,二级标题分类成功匹配到招标或者竞谈,并且detail中含有合同金额等其他字段,
|
|
@@ -255,13 +253,8 @@ func NewClassificationRun(tt *TTask, tmp map[string]interface{}) *tools.SortMap
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- cid := c.Cid //类id
|
|
|
|
- s_pid := c.S_pid //父类id
|
|
|
|
- if c.S_pid == "" { //表示一级分类字段
|
|
|
|
- topMap["top"] = c.S_savefield
|
|
|
|
- } else {
|
|
|
|
- topMap["sub"] = c.S_savefield
|
|
|
|
- }
|
|
|
|
|
|
+ cid := c.Cid //类id
|
|
|
|
+ s_pid := c.S_pid //父类id
|
|
//s_fields := c.S_fields //识别字段
|
|
//s_fields := c.S_fields //识别字段
|
|
savefield := c.S_savefield //保存字段,toptype
|
|
savefield := c.S_savefield //保存字段,toptype
|
|
// if tt.I_multiclass == 0 { //单分类临时记录保存字段
|
|
// if tt.I_multiclass == 0 { //单分类临时记录保存字段
|
|
@@ -438,8 +431,7 @@ func NewClassificationRun(tt *TTask, tmp map[string]interface{}) *tools.SortMap
|
|
}
|
|
}
|
|
//设置默认值
|
|
//设置默认值
|
|
//log.Println("smp", SMap.Map, SMap.Keys)
|
|
//log.Println("smp", SMap.Map, SMap.Keys)
|
|
- //一级分类打上了,才会设置二级默认值
|
|
|
|
- if savefield != "" && SMap.Map[savefield] == nil && c.S_default != "" && SMap.Map[topMap["top"]] != nil {
|
|
|
|
|
|
+ if savefield != "" && SMap.Map[savefield] == nil && c.S_default != "" {
|
|
if tt.I_multiclass == 0 { //单分类
|
|
if tt.I_multiclass == 0 { //单分类
|
|
//if savefield == "buyerclass" && util.ObjToString(tmp["buyer"]) == "" { //buyer不存在时,无buyerclass字段
|
|
//if savefield == "buyerclass" && util.ObjToString(tmp["buyer"]) == "" { //buyer不存在时,无buyerclass字段
|
|
// return SMap
|
|
// return SMap
|