indexer

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchIndexer

type BatchIndexer struct {
	// contains filtered or unexported fields
}

BatchIndexer wraps around a Bleve indexer for batch writing.

func (BatchIndexer) Commit

func (b BatchIndexer) Commit()

Commit commits the batched writes.

func (BatchIndexer) IndexRoomMember

func (b BatchIndexer) IndexRoomMember(m *event.RoomMemberEvent)

IndexRoomMember indexes the given room member from the event.

type IndexedRoomMember

type IndexedRoomMember struct {
	ID   matrix.UserID `json:"id"`
	Room matrix.RoomID `json:"room_id"`
	Name string        `json:"name"`
}

IndexedRoomMember is the data structure representing indexed room member information.

func (*IndexedRoomMember) Index

func (m *IndexedRoomMember) Index(b *bleve.Batch) error

Index indexes m into the given Bleve indexer.

func (*IndexedRoomMember) Type

func (m *IndexedRoomMember) Type() string

Type returns RoomMember.

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

Indexer provides indexing of many types of Matrix data for querying.

func Open

func Open(path string) (*Indexer, error)

Open opens an existing Indexer or create a new one if not available.

func (*Indexer) Begin

func (idx *Indexer) Begin() BatchIndexer

Begin creates a new batch indexer.

func (*Indexer) SearchRoomMember

func (idx *Indexer) SearchRoomMember(roomID matrix.RoomID, limit int) RoomMemberSearcher

SearchRoomMember returns a new instance of RoomMemberSearcher that the client can use to search room members.

type RoomMemberSearcher

type RoomMemberSearcher struct {
	// contains filtered or unexported fields
}

func (*RoomMemberSearcher) Search

Search looks up the indexing database and searches for the given string. The returned list of IDs is valid until the next time Search is called.

Jump to

Keyboard shortcuts

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