|
@@ -492,16 +492,9 @@ func (m *Front) PcAjaxReq() {
|
|
|
if list != nil {
|
|
|
listSize = len(*list)
|
|
|
}
|
|
|
- if len([]rune(s_word)) > 3 && int(count) < pc_pageSize && start == 0 {
|
|
|
+ if len([]rune(s_word)) > 3 && int(count) < pc_pageSize && start == 0 && selectType == "title" {
|
|
|
secondKWS = jy.HttpEs(s_word, "ik_smart", config.Sysconfig["elasticsearch"].(string))
|
|
|
- // 移动端数据导出改
|
|
|
- //findfields := `"title"`
|
|
|
- findfields := `"`
|
|
|
- findfields += m.GetString("selectType")
|
|
|
- findfields += `"`
|
|
|
- if findfields == `"all"` {
|
|
|
- findfields = `"title","detail"`
|
|
|
- }
|
|
|
+ findfields := `"title"`
|
|
|
qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(area, publishtime, subtype))
|
|
|
secondLimit := 2*pc_pageSize - int(count)
|
|
|
secRel := elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, bidSearch_field, 0, secondLimit, 0, false)
|
|
@@ -509,15 +502,6 @@ func (m *Front) PcAjaxReq() {
|
|
|
public.BidListConvert(industry, secRel)
|
|
|
}
|
|
|
if list != nil {
|
|
|
- // for _, v := range *list {
|
|
|
- // for n, m := range *secRel {
|
|
|
- // if util.ObjToString(v["_id"]) == util.ObjToString(m["_id"]) {
|
|
|
- // *secRel = append((*secRel)[0:n], (*secRel)[n+1:]...)
|
|
|
- // break
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // *list = append(*list, *secRel...)
|
|
|
list = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
|
|
|
} else {
|
|
|
list = secRel
|
|
@@ -752,7 +736,7 @@ func getLastNewsQuery(area, publishtime, subtype, industry string) string {
|
|
|
starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
|
|
|
} else if publishtime == "thisyear" { //去年
|
|
|
starttime = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix())
|
|
|
- endtime = fmt.Sprint(time.Date(now.Year(), 1, 1, 0, 0, 0, 0, time.Local).Unix())
|
|
|
+ endtime = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix())
|
|
|
} else {
|
|
|
starttime = strings.Split(publishtime, "_")[0]
|
|
|
endtime = strings.Split(publishtime, "_")[1]
|
|
@@ -875,14 +859,10 @@ func (m *Front) WxsearchlistPaging() {
|
|
|
if list != nil {
|
|
|
listSize = len(*list)
|
|
|
}
|
|
|
- if len([]rune(s_word)) > 3 && listSize < pc_pageSize && pageNum == 1 {
|
|
|
+ if len([]rune(s_word)) > 3 && listSize < pc_pageSize && pageNum == 1 && selectType == "title" {
|
|
|
secondKWS = jy.HttpEs(s_word, "ik_smart", config.Sysconfig["elasticsearch"].(string))
|
|
|
findfields := `"title"`
|
|
|
qstr := getSearchQuery(secondKWS, industry, minprice, maxprice, findfields, getBidSearchQuery(scope, publishtime, subtype))
|
|
|
- // var secondCount int64 = 0
|
|
|
- // if qstr != "" {
|
|
|
- // secondCount = elastic.Count(INDEX, TYPE, qstr)
|
|
|
- // }
|
|
|
secondLimit := 2*pc_pageSize - listSize
|
|
|
secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, filed, 0, secondLimit, 0, false)
|
|
|
if secRel != nil && len(*secRel) > 0 {
|
|
@@ -891,15 +871,6 @@ func (m *Front) WxsearchlistPaging() {
|
|
|
v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
|
|
|
}
|
|
|
if list != nil {
|
|
|
- // for _, v := range *list {
|
|
|
- // for n, m := range *secRel {
|
|
|
- // if util.ObjToString(v["_id"]) == util.ObjToString(m["_id"]) {
|
|
|
- // *secRel = append((*secRel)[0:n], (*secRel)[n+1:]...)
|
|
|
- // break
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // *list = append(*list, *secRel...)
|
|
|
list = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
|
|
|
} else {
|
|
|
list = secRel
|