|
@@ -77,8 +77,8 @@ func SearchMediaList(mediaType string, key string, from int, size int, max int64
|
|
|
return
|
|
|
}
|
|
|
func SearchMaxMediaId(mediaType string, key string) (total int64, latestId int64) {
|
|
|
- sort := []string{"mediaId:desc"}
|
|
|
- request := matchAllByCondition(sort, key, ConditionColumn, mediaType)
|
|
|
+ mediaSort := []string{"mediaId:desc"}
|
|
|
+ request := matchAllByCondition(mediaSort, key, ConditionColumn, mediaType)
|
|
|
//同步es
|
|
|
//re, err := elastic().Search(request)
|
|
|
re, err := elastic().Count(request)
|
|
@@ -88,7 +88,7 @@ func SearchMaxMediaId(mediaType string, key string) (total int64, latestId int64
|
|
|
count := re.Count
|
|
|
total = int64(count)
|
|
|
if total > 0 {
|
|
|
- request = matchByCondition(sort, key, ConditionColumn, mediaType, 0, count)
|
|
|
+ request = matchByCondition(mediaSort, key, ConditionColumn, mediaType, 0, count)
|
|
|
re, err = elastic().Search(request)
|
|
|
if err != nil {
|
|
|
logger.Error("es搜索异常:%v", err)
|