|
@@ -515,13 +515,9 @@ func (s *subscribePush) inactiveQuery(spqp *SubPushQueryParam, bsp *ViewConditio
|
|
starttime = time.Now().AddDate(0, 0, -15).Unix()
|
|
starttime = time.Now().AddDate(0, 0, -15).Unix()
|
|
endtime = time.Now().Unix()
|
|
endtime = time.Now().Unix()
|
|
}
|
|
}
|
|
- qstr := s.getFreeDatasSQL(bsp, starttime, endtime, (spqp.PageNum-1)*spqp.PageSize)
|
|
|
|
- log.Println("inactiveQuery---:", qstr)
|
|
|
|
|
|
+ qstr := s.getFreeDatasSQL(bsp, starttime, endtime, (spqp.PageNum-1)*spqp.PageSize, spqp.PageSize)
|
|
//list = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSort, bidField, 0, 4500, 0, false)
|
|
//list = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSort, bidField, 0, 4500, 0, false)
|
|
count, list = elastic.GetWithCount(INDEX, TYPE, "", qstr)
|
|
count, list = elastic.GetWithCount(INDEX, TYPE, "", qstr)
|
|
- if len(*list) > spqp.PageSize {
|
|
|
|
- *list = (*list)[:spqp.PageSize]
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
if count > 500 {
|
|
if count > 500 {
|
|
count = 500
|
|
count = 500
|
|
@@ -1490,7 +1486,7 @@ func getKeys(title string, keywords []ViewKeyWord) (str []string) {
|
|
}
|
|
}
|
|
|
|
|
|
// 获取查询语句
|
|
// 获取查询语句
|
|
-func (s *subscribePush) getFreeDatasSQL(bsp *ViewCondition, startTime, endTime int64, startNumb int) (str string) {
|
|
|
|
|
|
+func (s *subscribePush) getFreeDatasSQL(bsp *ViewCondition, startTime, endTime int64, startNumb, size int) (str string) {
|
|
query := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": %d}},"_source":[%s],"sort": [{"publishtime": "desc"}],"from":%d,"size":%d}`
|
|
query := `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match": %d}},"_source":[%s],"sort": [{"publishtime": "desc"}],"from":%d,"size":%d}`
|
|
query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
|
|
query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
|
|
multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
|
|
multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
|