fulltext

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexElement

type IndexElement struct {
	EventID        string
	RoomID         string
	Content        string
	ContentType    string
	StreamPosition int64
}

IndexElement describes the layout of an element to index

func (*IndexElement) SetContentType

func (i *IndexElement) SetContentType(v string)

SetContentType sets i.ContentType given an identifier

type Search struct {
	FulltextIndex bleve.Index
}

Search contains all existing bleve.Index

func New

func New(cfg config.Fulltext) (fts *Search, err error)

New opens a new/existing fulltext index

func (*Search) Close

func (f *Search) Close() error

Close closes the fulltext index

func (*Search) Delete

func (f *Search) Delete(eventID string) error

Delete deletes an indexed element by the eventID

func (*Search) Index

func (f *Search) Index(elements ...IndexElement) error

Index indexes the given elements

func (*Search) Search

func (f *Search) Search(term string, roomIDs, keys []string, limit, from int, orderByStreamPos bool) (*bleve.SearchResult, error)

Search searches the index given a search term, roomIDs and keys.

Jump to

Keyboard shortcuts

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