index

package
v0.0.0-...-14d575d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChangesIndexName             = "_changes"
	ChangesIndexInvalidationName = "_changes:invalidation"
)
View Source
const DeletedIndexName = "_deleted"

Variables

This section is empty.

Functions

func LocalSeq

LocalSeq will add the local sequence of the document to the document

Types

type ChangesIndex

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

func NewChangesIndex

func NewChangesIndex() *ChangesIndex

func (*ChangesIndex) DocumentDeleted

func (i *ChangesIndex) DocumentDeleted(ctx context.Context, tx port.EngineWriteTransaction, doc *model.Document) error

func (*ChangesIndex) DocumentStored

func (i *ChangesIndex) DocumentStored(ctx context.Context, tx port.EngineWriteTransaction, doc *model.Document) error

func (*ChangesIndex) Ensure

func (*ChangesIndex) IteratorOptions

func (i *ChangesIndex) IteratorOptions(ctx context.Context) (*model.IteratorOptions, error)

func (*ChangesIndex) Remove

func (*ChangesIndex) Stats

func (*ChangesIndex) String

func (i *ChangesIndex) String() string

func (*ChangesIndex) UpdateStored

func (i *ChangesIndex) UpdateStored(ctx context.Context, tx port.EngineWriteTransaction, docs []*model.Document) error

type ExternalSearchIndex

type ExternalSearchIndex struct {
	SearchFn string
	// contains filtered or unexported fields
}

func NewExternalSearchIndex

func NewExternalSearchIndex(ddfn *model.DesignDocFn, engines port.ViewEngines, path string) *ExternalSearchIndex

func (*ExternalSearchIndex) DocumentDeleted

func (*ExternalSearchIndex) DocumentStored

func (*ExternalSearchIndex) Ensure

func (*ExternalSearchIndex) IteratorOptions

func (i *ExternalSearchIndex) IteratorOptions(ctx context.Context) (*model.IteratorOptions, error)

func (*ExternalSearchIndex) Remove

func (*ExternalSearchIndex) SearchDocuments

func (i *ExternalSearchIndex) SearchDocuments(ctx context.Context, ddfn *model.DesignDocFn, sq *port.SearchQuery) (*port.SearchResult, error)

func (*ExternalSearchIndex) SourceType

func (i *ExternalSearchIndex) SourceType() model.FnType

func (*ExternalSearchIndex) Stats

func (*ExternalSearchIndex) String

func (i *ExternalSearchIndex) String() string

func (*ExternalSearchIndex) UpdateMapping

func (i *ExternalSearchIndex) UpdateMapping(docs []*model.Document) error

UpdateMapping can extend the mapping configuration for the index. NOT: CouchDB inherited behavior is, that the index can only be extended but fields can't be removed, for that the index has to be rebuild. Also the configuration of a field can't be changed once given.

func (*ExternalSearchIndex) UpdateSource

func (i *ExternalSearchIndex) UpdateSource(ctx context.Context, doc *model.Document, f *model.Function) error

func (*ExternalSearchIndex) UpdateStored

type IndexFunc

type IndexFunc func(doc *model.Document) []byte

type IterKeyFunc

type IterKeyFunc func(k []byte) []byte

type RegularIndex

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

RegularIndex is able to store the same value multiple times, does so by adding the document id (which is unique) to the end of the document key.

func NewRegularIndex

func NewRegularIndex(ddfn *model.DesignDocFn, idxFn RegularIndexFunc) *RegularIndex

func (*RegularIndex) DocumentDeleted

func (i *RegularIndex) DocumentDeleted(ctx context.Context, tx port.EngineWriteTransaction, doc *model.Document) error

func (*RegularIndex) DocumentStored

func (i *RegularIndex) DocumentStored(ctx context.Context, tx port.EngineWriteTransaction, doc *model.Document) error

func (*RegularIndex) Ensure

func (*RegularIndex) IteratorOptions

func (i *RegularIndex) IteratorOptions(ctx context.Context) (*model.IteratorOptions, error)

func (*RegularIndex) Remove

func (*RegularIndex) RemoveOldKeys

func (i *RegularIndex) RemoveOldKeys(tx port.EngineWriteTransaction, doc *model.Document) error

func (*RegularIndex) Stats

func (*RegularIndex) String

func (i *RegularIndex) String() string

func (*RegularIndex) UpdateStored

func (i *RegularIndex) UpdateStored(ctx context.Context, tx port.EngineWriteTransaction, docs []*model.Document) error

type RegularIndexFunc

type RegularIndexFunc func(ctx context.Context, doc *model.Document) ([][]byte, [][]byte)

RegularIndexFunc gets a document and returns multiple keys and values or nil, nil.

type UniqueIndex

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

UniqueIndex base class for all indices that are based on a bucket and work synchronously.

func NewDeletedIndex

func NewDeletedIndex() *UniqueIndex

func NewUniqueIndex

func NewUniqueIndex(bucketName string, key, value IndexFunc) *UniqueIndex

func (*UniqueIndex) DocumentDeleted

func (i *UniqueIndex) DocumentDeleted(ctx context.Context, tx port.EngineWriteTransaction, doc *model.Document) error

func (*UniqueIndex) DocumentStored

func (i *UniqueIndex) DocumentStored(ctx context.Context, tx port.EngineWriteTransaction, doc *model.Document) error

func (*UniqueIndex) Ensure

func (*UniqueIndex) IteratorOptions

func (i *UniqueIndex) IteratorOptions(ctx context.Context) (*model.IteratorOptions, error)

func (*UniqueIndex) Remove

func (*UniqueIndex) Stats

func (*UniqueIndex) String

func (i *UniqueIndex) String() string

func (*UniqueIndex) UpdateStored

func (i *UniqueIndex) UpdateStored(ctx context.Context, tx port.EngineWriteTransaction, docs []*model.Document) error

type UniqueIndexUint64

type UniqueIndexUint64 struct {
	UniqueIndex
}

func NewUniqueIndexUint64

func NewUniqueIndexUint64(name string, kf UniqueIndexUint64KeyFunc, value IndexFunc) *UniqueIndexUint64

NewUniqueIndexUint64 creates a sorted uint64 index that can be scanned in order using the iterator

func (*UniqueIndexUint64) String

func (i *UniqueIndexUint64) String() string

type UniqueIndexUint64KeyFunc

type UniqueIndexUint64KeyFunc func(doc *model.Document) uint64

type ViewIndex

type ViewIndex struct {
	*RegularIndex
	MapFn string
	// contains filtered or unexported fields
}

func NewViewIndex

func NewViewIndex(ddfn *model.DesignDocFn, engines port.ViewEngines) *ViewIndex

func (*ViewIndex) SourceType

func (i *ViewIndex) SourceType() model.FnType

func (*ViewIndex) String

func (i *ViewIndex) String() string

func (*ViewIndex) UpdateSource

func (i *ViewIndex) UpdateSource(ctx context.Context, doc *model.Document, vf *model.Function) error

updateSource updates the view source and starts rebuilding the whole index

Jump to

Keyboard shortcuts

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