search

package
Version: v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: BSD-3-Clause Imports: 14 Imported by: 36

Documentation

Overview

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.

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

Functions

func Backup

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

func DeleteIndex(id string) error

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

func MapIndex

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

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

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

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

Types

type Searchable

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

Searchable ...

Jump to

Keyboard shortcuts

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