Documentation ¶
Overview ¶
Package indexer indexes objects that implement the Indexable interface. The index is all in memory right now, but it can be frozen and saved to disk for persistence.
Index ¶
- func ClearIndex()
- func CreateNewCollection(idxName string)
- func DeleteCollection(idxName string) error
- func DeleteItemFromCollection(idxName string, doc string) error
- func Endpoints() []string
- func IndexObj(object Indexable)
- func LoadIndex(idxFile string) error
- func ReIndex(objects []Indexable) error
- func SaveIndex(idxFile string) error
- func SearchIndex(idxName string, term string, notop bool) (map[string]*IdxDoc, error)
- func SearchRange(idxName string, field string, start string, end string, inclusive bool) (map[string]*IdxDoc, error)
- func SearchText(idxName string, term string, notop bool) (map[string]*IdxDoc, error)
- type IdxCollection
- type IdxDoc
- func (idoc *IdxDoc) Examine(term string) (bool, error)
- func (i *IdxDoc) GobDecode(buf []byte) error
- func (i *IdxDoc) GobEncode() ([]byte, error)
- func (idoc *IdxDoc) RangeSearch(field string, start string, end string, inclusive bool) (bool, error)
- func (idoc *IdxDoc) TextSearch(term string) (bool, error)
- type Index
- type Indexable
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 ¶
Delete a collection from the index. Useful only for data bags.
func DeleteItemFromCollection ¶
Delete an item from a collection
func SearchIndex ¶
Search for a string in the given index. Returns a slice of names of matching objects, or an error on failure.
Types ¶
type IdxCollection ¶
type IdxCollection struct {
// contains filtered or unexported fields
}
Holds a map of documents.
func (*IdxCollection) GobDecode ¶ added in v0.3.0
func (i *IdxCollection) GobDecode(buf []byte) error
func (*IdxCollection) GobEncode ¶ added in v0.3.0
func (i *IdxCollection) GobEncode() ([]byte, error)
type IdxDoc ¶
type IdxDoc struct {
// contains filtered or unexported fields
}
The indexed documents that are actually searched.
func (*IdxDoc) Examine ¶
Searches a document, determining if it needs to do a search for an exact term or a regexp search.