You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/dao/search.go

29 lines
653 B

2 years ago
package dao
import (
"github.com/rocboss/paopao-ce/internal/conf"
"github.com/rocboss/paopao-ce/internal/core"
"github.com/rocboss/paopao-ce/pkg/zinc"
"github.com/sirupsen/logrus"
2 years ago
)
var (
_ core.TweetSearchService = (*zincTweetSearchServant)(nil)
)
2 years ago
type zincTweetSearchServant struct {
indexName string
client *zinc.ZincClient
2 years ago
}
func NewTweetSearchService() (ts core.TweetSearchService) {
if conf.CfgIf("Zinc") {
ts = newZincTweetSearchServant()
} else {
// default use Zinc as tweet search service
ts = newZincTweetSearchServant()
2 years ago
}
logrus.Infof("use %s as tweet search serice by version %s", ts.Name(), ts.Version())
return
2 years ago
}