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 ¶
- 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) RangeSearch ¶
Click to show internal directories.
Click to hide internal directories.