WIP: Node. New generation #1
@ -502,6 +502,7 @@ func (es ESConf) GetThreads(pageNum int, echoes ...string) (posts []i2es.ESDoc)
|
|||||||
from := 30 * pageNum
|
from := 30 * pageNum
|
||||||
rangeStr = fmt.Sprintf(`"from":"now-%dd","to":"now-%dd"`, from, to)
|
rangeStr = fmt.Sprintf(`"from":"now-%dd","to":"now-%dd"`, from, to)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug(rangeStr)
|
log.Debug(rangeStr)
|
||||||
|
|
||||||
query := `{"sort":[{"date":{"order":"desc"}}],"aggs":{"topics":{"terms":{"field":"topicid.keyword","size":100},"aggs":{"post":{"top_hits":{"size":1,"sort":[{"date":{"order":"desc"}}],"_source":{"include": ["subg","author","date","echo","topicid","address", "repto"]}}}}}},"query":{"bool":{"must":[{"range":{"date":{` + rangeStr + `}}},{"constant_score":{"filter":{"terms":{"echo.keyword": [` +
|
query := `{"sort":[{"date":{"order":"desc"}}],"aggs":{"topics":{"terms":{"field":"topicid.keyword","size":100},"aggs":{"post":{"top_hits":{"size":1,"sort":[{"date":{"order":"desc"}}],"_source":{"include": ["subg","author","date","echo","topicid","address", "repto"]}}}}}},"query":{"bool":{"must":[{"range":{"date":{` + rangeStr + `}}},{"constant_score":{"filter":{"terms":{"echo.keyword": [` +
|
||||||
@ -597,7 +598,6 @@ func (es ESConf) GetThreadsYear(pageNum int, echoes ...string) (posts []i2es.ESD
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (es ESConf) GetLatestPosts(sum int) []i2es.ESDoc {
|
func (es ESConf) GetLatestPosts(sum int) []i2es.ESDoc {
|
||||||
log.Debug(sum)
|
|
||||||
query := fmt.Sprintf(`{"sort": [{"date": {"order": "desc"}}, {"_score": {"order": "desc" }}], "size": %d}`, sum)
|
query := fmt.Sprintf(`{"sort": [{"date": {"order": "desc"}}, {"_score": {"order": "desc" }}], "size": %d}`, sum)
|
||||||
log.Debugf("Do %s request", query)
|
log.Debugf("Do %s request", query)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user