search

package
v2.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const IndexVersion = 2

Bumped whenever there are tokenization or structural changes to building the index

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

type Indexer struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewIndexer

func NewIndexer(g *globals.Context) *Indexer

func (*Indexer) Add

func (idx *Indexer) Add(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID,
	msgs []chat1.MessageUnboxed) (err error)

func (*Indexer) GetConvIndex

func (idx *Indexer) GetConvIndex(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID) (*chat1.ConversationIndex, error)

func (*Indexer) IndexInbox

func (idx *Indexer) IndexInbox(ctx context.Context, uid gregor1.UID) (res map[string]chat1.ProfileSearchConvStats, err error)

IndexInbox is only exposed in devel for debugging/profiling the indexing process.

func (*Indexer) Remove

func (idx *Indexer) Remove(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID,
	msgs []chat1.MessageUnboxed) (err error)

func (*Indexer) Search

func (idx *Indexer) Search(ctx context.Context, uid gregor1.UID, query 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) SetConsumeCh

func (idx *Indexer) SetConsumeCh(ch chan chat1.ConversationID)

func (*Indexer) SetPageSize

func (idx *Indexer) SetPageSize(pageSize int)

func (*Indexer) SetReindexCh

func (idx *Indexer) SetReindexCh(ch chan chat1.ConversationID)

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,
	re *regexp.Regexp, uiCh chan chat1.ChatSearchHit, opts chat1.SearchOpts) (hits []chat1.ChatSearchHit, err error)

func (*RegexpSearcher) SetPageSize

func (s *RegexpSearcher) SetPageSize(pageSize int)

Jump to

Keyboard shortcuts

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