Documentation ¶
Index ¶
- Constants
- Variables
- func BatchDeleteInvertedIndexPath(ctx context.Context, keys []string) (err error)
- func DeleteInvertedIndexPath(ctx context.Context, key string) (err error)
- func GetInvertedIndexDbPathMonthKey(month string) string
- func GetInvertedIndexDbPathSeasonKey(season string) string
- func GetInvertedIndexTokenDocIds(ctx context.Context, token string) (docIds *roaring.Bitmap, err error)
- func GetInvertedPath(ctx context.Context, key string) (path string, err error)
- func InitRedis()
- func ListAllPrefixKey(ctx context.Context, prefixKey string) (paths []string, err error)
- func ListInvertedIndexByPrefixKey(ctx context.Context, prefixKey string) (paths []string, err error)
- func ListInvertedIndexToken(ctx context.Context, userId int64) (tokens []string, err error)
- func ListInvertedPath(ctx context.Context, keys []string) (paths []string, err error)
- func PushInvertedIndexToken(ctx context.Context, userId int64, token string) (err error)
- func PushInvertedMonthPath(ctx context.Context, key string, paths []string) (err error)
- func PushInvertedPath(ctx context.Context, key string, paths []string) (err error)
- func SetInvertedIndexTokenDocIds(ctx context.Context, token string, docIds *roaring.Bitmap) (err error)
- func SetInvertedPath(ctx context.Context, key string, path string) (err error)
Constants ¶
View Source
const ( InvertedIndexDbPathDayKey = "index_platform:inverted_index:day" // 天纬度 InvertedIndexDbPathMonthKey = "index_platform:inverted_index:month:%s" // 月纬度 InvertedIndexDbPathSeasonKey = "index_platform:inverted_index:season:%s" // 季纬度 TireTreeDbPathDayKey = "index_platform:tire_tree:day" // 天纬度 TireTreeDbPathMonthKey = "index_platform:tire_tree:month:%s" // 月纬度 TireTreeDbPathSeasonKey = "index_platform:tire_tree:season:%s" // 季纬度 // QueryTokenDocIds 搜索过的token的doc ids query:term --> docs ids QueryTokenDocIds = "query_doc_id:%s" // UserQueryToken 用户搜索过的token query:user_id --> term UserQueryToken = "query_token:%d" )
View Source
const (
QueryTokenDocIdsDefaultTimeout = 10 * time.Minute
)
Variables ¶
View Source
var InvertedIndexDbPathKeys = []string{InvertedIndexDbPathDayKey, InvertedIndexDbPathMonthKey, InvertedIndexDbPathSeasonKey}
InvertedIndexDbPathKeys 存放倒排索引的路径
View Source
var RedisClient *redis.Client
RedisClient Redis缓存客户端单例
View Source
var RedisContext = context.Background()
View Source
var TireTreeDbPathKey = []string{TireTreeDbPathDayKey, TireTreeDbPathMonthKey, TireTreeDbPathSeasonKey, }
TireTreeDbPathKey 存放tire tree树的路径
Functions ¶
func BatchDeleteInvertedIndexPath ¶ added in v0.1.2
BatchDeleteInvertedIndexPath 批量删除 inverted index path
func DeleteInvertedIndexPath ¶ added in v0.1.2
DeleteInvertedIndexPath 删除 inverted index path
func GetInvertedIndexDbPathMonthKey ¶ added in v0.1.2
func GetInvertedIndexDbPathSeasonKey ¶ added in v0.1.2
func GetInvertedIndexTokenDocIds ¶
func GetInvertedIndexTokenDocIds(ctx context.Context, token string) (docIds *roaring.Bitmap, err error)
GetInvertedIndexTokenDocIds 获取缓存的结果
func GetInvertedPath ¶ added in v0.1.2
GetInvertedPath 获取存储的path信息
func ListAllPrefixKey ¶ added in v0.1.2
ListAllPrefixKey 通过前缀获取所有的value index_platform:inverted_index:month:*
func ListInvertedIndexByPrefixKey ¶ added in v0.1.2
func ListInvertedIndexByPrefixKey(ctx context.Context, prefixKey string) (paths []string, err error)
ListInvertedIndexByPrefixKey 通过前缀获取所有的value index_platform:inverted_index:month:*
func ListInvertedIndexToken ¶
ListInvertedIndexToken 获取用户搜索的历史记录
func ListInvertedPath ¶
ListInvertedPath 把存放在redis的信息放到path中 包括day,week,season的
func PushInvertedIndexToken ¶
PushInvertedIndexToken 存储用户搜索的历史记录 docs ids // TODO:后面嵌入LRU
func PushInvertedMonthPath ¶ added in v0.1.2
PushInvertedMonthPath 把存放db的path信息放到redis中 month 纬度
func PushInvertedPath ¶
PushInvertedPath 把存放db的path信息放到redis中
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.