|
@@ -91,6 +91,35 @@ func DataCount(uid, item string, index int) int64 {
|
|
|
return elastic.Count(INDEX, TYPE, qstr)
|
|
|
}
|
|
|
|
|
|
+func KeysetDataCount(userId, key, notkey string, matchway int) int64 {
|
|
|
+ key = strings.TrimSpace(key)
|
|
|
+ notkey = strings.TrimSpace(notkey)
|
|
|
+ if key == "" {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ // sql := GetSqlObjFromId(userId, "", -1)
|
|
|
+ sql := GetSqlObjFromFreeId(userId, "", -1)
|
|
|
+ viewKeyWords := []ViewKeyWord{}
|
|
|
+ if matchway == 0 {
|
|
|
+ viewKeyWords = append(viewKeyWords, ViewKeyWord{
|
|
|
+ Keyword: strings.Split(key, " "),
|
|
|
+ Exclude: strings.Split(notkey, " "),
|
|
|
+ MatchWay: matchway,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ for _, v := range strings.Split(key, " ") {
|
|
|
+ viewKeyWords = append(viewKeyWords, ViewKeyWord{
|
|
|
+ Keyword: []string{v},
|
|
|
+ Exclude: strings.Split(notkey, " "),
|
|
|
+ MatchWay: matchway,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sql.Keyword = viewKeyWords
|
|
|
+ qstr := GetVIPViewSql(userId, sql)
|
|
|
+ return elastic.Count(INDEX, TYPE, qstr)
|
|
|
+}
|
|
|
+
|
|
|
func SubViewDatas(userId, allquery string, pageNum int) (keys []interface{}, list *[]map[string]interface{}, hasNextPage bool) {
|
|
|
if userId == "" {
|
|
|
return
|