pgsearch

package
v0.0.0-...-2bc625b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	NewStore,
	wire.Struct(new(Service), "*"),
)
View Source
var ErrMissingCredential = apierrors.InternalError.WithReason("SearchDisabled").New("search database credential is not provided")

Functions

func MapUnicodeSegmentation

func MapUnicodeSegmentation(original map[string]string) map[string]string

func StringUnicodeSegmentation

func StringUnicodeSegmentation(original string) string

Types

type Service

type Service struct {
	AppID    *config.AppID
	Store    *Store
	Database *searchdb.Handle
}

func (*Service) DeleteUser

func (s *Service) DeleteUser(
	ctx context.Context, userID string) error

func (*Service) QueryUser

func (s *Service) QueryUser(
	ctx context.Context,
	searchKeyword string,
	filters user.FilterOptions,
	sortOption user.SortOption,
	pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, error)

func (*Service) ReindexUser

func (s *Service) ReindexUser(
	ctx context.Context, user *apimodel.SearchUserSource) error

type Store

type Store struct {
	AppID       config.AppID
	SQLBuilder  *searchdb.SQLBuilder
	SQLExecutor *searchdb.SQLExecutor
}

func NewStore

func NewStore(
	appID config.AppID,
	sqlBuilder *searchdb.SQLBuilder,
	sqlExecutor *searchdb.SQLExecutor,
) *Store

func (*Store) CleanupUsers

func (s *Store) CleanupUsers(ctx context.Context, appID string, keepUserIDs []string) (int64, error)

func (*Store) DeleteUser

func (s *Store) DeleteUser(ctx context.Context, appID string, userID string) error

func (*Store) QueryUser

func (s *Store) QueryUser(
	ctx context.Context,
	searchKeyword string,
	filters user.FilterOptions,
	sortOption user.SortOption,
	pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, error)

func (*Store) UpsertUsers

func (s *Store) UpsertUsers(ctx context.Context, users []*model.SearchUserSource) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL