indexer

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2014 License: Apache-2.0 Imports: 7 Imported by: 77

Documentation

Overview

Index objects that implement the Indexable interface. All in memory right now, but the possibility is open to later saving the index to disk for later use if a full solr installation (with the attendant improved functionality, admittedly) is not needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewCollection

func CreateNewCollection(idxName string)

Create an index for data bags when they are created, rather than when the first data bag item is uploaded

func DeleteCollection

func DeleteCollection(idxName string) error

Delete a collection from the index. Useful only for data bags.

func DeleteItemFromCollection

func DeleteItemFromCollection(idxName string, doc string) error

Delete an item from a collection

func Endpoints

func Endpoints() []string

Return a list of currently indexed endpoints

func IndexObj

func IndexObj(object Indexable)

Process and add an object to the index.

func SearchIndex

func SearchIndex(idxName string, term string, notop bool) (map[string]*IdxDoc, error)

Search for a string in the given index. Returns a slice of names of matching objects, or an error on failure.

func SearchRange

func SearchRange(idxName string, field string, start string, end string, inclusive bool) (map[string]*IdxDoc, error)

func SearchText

func SearchText(idxName string, term string, notop bool) (map[string]*IdxDoc, error)

Types

type IdxCollection

type IdxCollection struct {
	// contains filtered or unexported fields
}

type IdxDoc

type IdxDoc struct {
	// contains filtered or unexported fields
}

func (*IdxDoc) Examine

func (idoc *IdxDoc) Examine(term string) (bool, error)

func (*IdxDoc) RangeSearch

func (idoc *IdxDoc) RangeSearch(field string, start string, end string, inclusive bool) (bool, error)

func (*IdxDoc) TextSearch

func (idoc *IdxDoc) TextSearch(term string) (bool, error)

type Index

type Index struct {
	// contains filtered or unexported fields
}

type Indexable

type Indexable interface {
	DocId() string
	Index() string
	Flatten() []string
}

Jump to

Keyboard shortcuts

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