Documentation ¶
Overview ¶
Package mongodb using a mongo db as a index engine for the search
Index ¶
Constants ¶
View Source
const MongoIndex = "mongodb"
MongoIndex name of the index component
Variables ¶
This section is empty.
Functions ¶
func InitMongoDB ¶
InitMongoDB initialize the mongo db for usage in this service
func ToMongoQuery ¶
ToMongoQuery converting a blobstorage query into a mango query
Types ¶
type Config ¶
type Config struct { Hosts []string `yaml:"hosts"` Database string `yaml:"database"` AuthDatabase string `yaml:"authdatabase"` Username string `yaml:"username"` Password string `yaml:"password"` }
Config configuration to the mongodb instance
type Index ¶
type Index struct { Tenant string // contains filtered or unexported fields }
Index one index for a tenant
func (*Index) Index ¶
func (m *Index) Index(id string, b model.BlobDescription) error
Index indexing a single blob
func (*Index) NewBatch ¶
func (m *Index) NewBatch() interfaces.IndexBatch
NewBatch creating a new batch for bulk index
type IndexBatch ¶
type IndexBatch struct {
// contains filtered or unexported fields
}
IndexBatch using batch functionality for indexing
func (*IndexBatch) Add ¶
func (i *IndexBatch) Add(id string, b model.BlobDescription) error
Add adding a single blob description to a batch
func (*IndexBatch) Index ¶
func (i *IndexBatch) Index() error
Index index all blobs in this batch TODO should use an mongo bulk operation
type MongoBlobDescription ¶
type MongoBlobDescription struct { model.BlobDescription ID primitive.ObjectID `bson:"_id,omitempty"` }
MongoBlobDescription the mongo blob description object
Click to show internal directories.
Click to hide internal directories.