Documentation ¶
Index ¶
- Constants
- func MinMaxIDs(conv chat1.Conversation) (min, max chat1.MessageID)
- func UpgradeSearchOptsFromQuery(query string, opts chat1.SearchOpts, username string) (string, chat1.SearchOpts)
- type Indexer
- func (idx *Indexer) Add(ctx context.Context, convID chat1.ConversationID, msgs []chat1.MessageUnboxed) (err error)
- func (idx *Indexer) CancelSync(ctx context.Context)
- func (idx *Indexer) Clear(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID) (err error)
- func (idx *Indexer) FullyIndexed(ctx context.Context, convID chat1.ConversationID) (res bool, err error)
- func (idx *Indexer) GetStoreHits(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, ...) (res map[chat1.MessageID]chat1.EmptyStruct, err error)
- func (idx *Indexer) IndexInbox(ctx context.Context) (res map[chat1.ConvIDStr]chat1.ProfileSearchConvStats, err error)
- func (idx *Indexer) IsBackgroundActive() bool
- func (idx *Indexer) OnDbNuke(mctx libkb.MetaContext) (err error)
- func (idx *Indexer) PercentIndexed(ctx context.Context, convID chat1.ConversationID) (res int, err error)
- func (idx *Indexer) PokeSync(ctx context.Context)
- func (idx *Indexer) Remove(ctx context.Context, convID chat1.ConversationID, msgs []chat1.MessageUnboxed) (err error)
- func (idx *Indexer) Resume(ctx context.Context) bool
- func (idx *Indexer) Search(ctx context.Context, query, origQuery string, opts chat1.SearchOpts, ...) (res *chat1.ChatSearchInboxResults, err error)
- func (idx *Indexer) SearchableConvs(ctx context.Context, convID *chat1.ConversationID) (res []types.RemoteConversation, err error)
- func (idx *Indexer) SelectiveSync(ctx context.Context) (err error)
- func (idx *Indexer) SetConsumeCh(ch chan chat1.ConversationID)
- func (idx *Indexer) SetFlushDelay(dur time.Duration)
- func (idx *Indexer) SetMaxSyncConvs(x int)
- func (idx *Indexer) SetPageSize(pageSize int)
- func (idx *Indexer) SetReindexCh(ch chan chat1.ConversationID)
- func (idx *Indexer) SetStartSyncDelay(d time.Duration)
- func (idx *Indexer) SetSyncLoopCh(ch chan struct{})
- func (idx *Indexer) SetUID(uid gregor1.UID)
- func (idx *Indexer) Start(ctx context.Context, uid gregor1.UID)
- func (idx *Indexer) StartFlushLoop()
- func (idx *Indexer) StartStorageLoop()
- func (idx *Indexer) StartSyncLoop()
- func (idx *Indexer) Stop(ctx context.Context) chan struct{}
- func (idx *Indexer) Suspend(ctx context.Context) bool
- func (idx *Indexer) SyncLoop(stopCh chan struct{}) error
- type RegexpSearcher
Constants ¶
View Source
const MaxAllowedSearchHits = 10000
View Source
const MaxAllowedSearchMessages = 100000
Only used by RegexpSearcher
View Source
const MaxContext = 15
Paging context around a search hit
View Source
const (
MinTokenLength = 3
)
Variables ¶
This section is empty.
Functions ¶
func UpgradeSearchOptsFromQuery ¶
func UpgradeSearchOptsFromQuery(query string, opts chat1.SearchOpts, username string) (string, chat1.SearchOpts)
Types ¶
type Indexer ¶
type Indexer struct { globals.Contextified utils.DebugLabeler sync.Mutex // contains filtered or unexported fields }
func NewIndexer ¶
func (*Indexer) Add ¶
func (idx *Indexer) Add(ctx context.Context, convID chat1.ConversationID, msgs []chat1.MessageUnboxed) (err error)
func (*Indexer) CancelSync ¶
func (*Indexer) FullyIndexed ¶
func (*Indexer) GetStoreHits ¶
func (*Indexer) IndexInbox ¶
func (idx *Indexer) IndexInbox(ctx context.Context) (res map[chat1.ConvIDStr]chat1.ProfileSearchConvStats, err error)
IndexInbox is only exposed in devel for debugging/profiling the indexing process.
func (*Indexer) IsBackgroundActive ¶
func (*Indexer) PercentIndexed ¶
func (*Indexer) Remove ¶
func (idx *Indexer) Remove(ctx context.Context, convID chat1.ConversationID, msgs []chat1.MessageUnboxed) (err error)
func (*Indexer) Search ¶
func (idx *Indexer) Search(ctx context.Context, query, origQuery string, opts chat1.SearchOpts, hitUICh chan chat1.ChatSearchInboxHit, indexUICh chan chat1.ChatSearchIndexStatus) (res *chat1.ChatSearchInboxResults, err error)
Search tokenizes the given query and finds the intersection of all matches for each token, returning matches.
func (*Indexer) SearchableConvs ¶
func (idx *Indexer) SearchableConvs(ctx context.Context, convID *chat1.ConversationID) (res []types.RemoteConversation, err error)
func (*Indexer) SelectiveSync ¶
SelectiveSync queues up a small number of jobs on the background loader periodically so our index can cover all conversations. The number of jobs varies between desktop and mobile so mobile can be more conservative.
func (*Indexer) SetConsumeCh ¶
func (idx *Indexer) SetConsumeCh(ch chan chat1.ConversationID)
func (*Indexer) SetFlushDelay ¶
func (*Indexer) SetMaxSyncConvs ¶
func (*Indexer) SetPageSize ¶
func (*Indexer) SetReindexCh ¶
func (idx *Indexer) SetReindexCh(ch chan chat1.ConversationID)
func (*Indexer) SetStartSyncDelay ¶
func (*Indexer) SetSyncLoopCh ¶
func (idx *Indexer) SetSyncLoopCh(ch chan struct{})
func (*Indexer) StartFlushLoop ¶
func (idx *Indexer) StartFlushLoop()
func (*Indexer) StartStorageLoop ¶
func (idx *Indexer) StartStorageLoop()
func (*Indexer) StartSyncLoop ¶
func (idx *Indexer) StartSyncLoop()
type RegexpSearcher ¶
type RegexpSearcher struct { globals.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func NewRegexpSearcher ¶
func NewRegexpSearcher(g *globals.Context) *RegexpSearcher
func (*RegexpSearcher) Search ¶
func (s *RegexpSearcher) Search(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, queryRe *regexp.Regexp, uiCh chan chat1.ChatSearchHit, opts chat1.SearchOpts) (hits []chat1.ChatSearchHit, msgHits []chat1.MessageUnboxed, err error)
func (*RegexpSearcher) SetPageSize ¶
func (s *RegexpSearcher) SetPageSize(pageSize int)
Click to show internal directories.
Click to hide internal directories.