search

package
v0.0.0-...-92505e6 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Search tracks all search indices to use throughout system
	Search map[string]bleve.Index

	// ErrNoIndex is for failed checks for an index in Search map
	ErrNoIndex = errors.New("no search index found for type provided")

	ContentTypes map[string]content.Creator
)

Functions

func CreateIndex

func CreateIndex(target string) *index

func MapIndex

func MapIndex(typeName string, searchDir string) error

MapIndex creates the mapping for a type and tracks the index to be used within the system for adding/deleting/checking data

func Setup

func Setup(cts map[string]content.Creator, searchDir string)

Setup initializes Search Index for search to be functional This was moved out of db.Init and put to main(), because addon checker was initializing db together with search indexing initialisation in time when there were no item.Types defined so search index was always empty when using addons. We still have no guarentee whatsoever that item.Types is defined Should be called from a goroutine after SetContent is successful (SortContent requirement)

func UpdateIndex

func UpdateIndex(ns, id string, data []byte) error

UpdateIndex sets data into a content type's search index at the given identifier

Types

type Index

type Index interface {
	Namespace() string
	ID() string
}

func TypeQuery

func TypeQuery(typeName, query string, count, offset int) ([]Index, error)

TypeQuery conducts a search and returns a set of Ponzu "targets", Type:ID pairs, and an error. If there is no search index for the typeName (Type) provided, db.ErrNoIndex will be returned as the error

Jump to

Keyboard shortcuts

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