search

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: BSD-3-Clause Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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