Skip to content

Commit

Permalink
Merge pull request #143 from alimy/main
Browse files Browse the repository at this point in the history
optimize #141 fixed zinc search not in expect result
  • Loading branch information
alimy committed Jun 25, 2022
2 parents db41020 + 5722fbf commit 9012c86
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/dao/search_zinc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/rocboss/paopao-ce/internal/model"
"github.com/rocboss/paopao-ce/pkg/json"
"github.com/rocboss/paopao-ce/pkg/zinc"
"github.com/sirupsen/logrus"
)

func newZincTweetSearchServant() *zincTweetSearchServant {
Expand Down Expand Up @@ -74,8 +75,15 @@ func (s *zincTweetSearchServant) Search(user *model.User, q *core.QueryReq, offs
resp, err = s.queryByContent(user, q, offset, limit)
} else if q.Type == core.SearchTypeTag && q.Query != "" {
resp, err = s.queryByTag(user, q, offset, limit)
} else {
resp, err = s.queryAny(user, offset, limit)
}
if err != nil {
logrus.Errorf("zincTweetSearchServant.search searchType:%s query:%s error:%v", q.Type, q.Query, err)
return
}
resp, err = s.queryAny(user, offset, limit)

logrus.Debugf("zincTweetSearchServant.Search type:%s query:%s resp Hits:%d NbHits:%d offset: %d limit:%d ", q.Type, q.Query, len(resp.Items), resp.Total, offset, limit)
s.filterResp(user, resp)
return
}
Expand Down

0 comments on commit 9012c86

Please sign in to comment.