ponzu: github.com/ponzu-cms/ponzu/system/search Index | Files

package search

import "github.com/ponzu-cms/ponzu/system/search"

Package search is a wrapper around the blevesearch/bleve search indexing and query package, and provides interfaces to extend Ponzu items with rich, full-text search capability.


Package Files

backup.go search.go


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")

func Backup Uses

func Backup(ctx context.Context, res http.ResponseWriter) error

Backup creates an archive of a project's search index and writes it to the response as a download

func DeleteIndex Uses

func DeleteIndex(id string) error

DeleteIndex removes data from a content type's search index at the given identifier

func MapIndex Uses

func MapIndex(typeName 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 TypeQuery Uses

func TypeQuery(typeName, query string, count, offset int) ([]string, 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

func UpdateIndex Uses

func UpdateIndex(id string, data interface{}) error

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

type Searchable Uses

type Searchable interface {
    SearchMapping() (*mapping.IndexMappingImpl, error)
    IndexContent() bool

Searchable ...

Package search imports 15 packages (graph) and is imported by 18 packages. Updated 2020-01-05. Refresh now. Tools for package owners.