Documentation
¶
Index ¶
- func BaseDocumentSize(d *storage.Document) (size uint64)
- func BaseFieldDefinitionSize(f *storage.FieldDefinition) (size uint64)
- func FloatField[T constraints.Float](dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], ...) (size uint64)
- func IntegerField[T constraints.Signed](dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], ...) (size uint64)
- func KeywordField(dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], ...) (size uint64)
- func TextField(dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], ...) (size uint64)
- func TimeField(dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], ...) (size uint64)
- func TokenSize(t *storage.TokenDefinition) (size uint64)
- type Batch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseDocumentSize ¶
func BaseFieldDefinitionSize ¶
func BaseFieldDefinitionSize(f *storage.FieldDefinition) (size uint64)
Computes the base size of the struct such as the raw size and the length of pointers found Caller still requires to compute the size of the tokens in the field
func FloatField ¶
func FloatField[T constraints.Float](dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], name string, v T) (size uint64)
func IntegerField ¶
func IntegerField[T constraints.Signed](dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], name string, v T) (size uint64)
func KeywordField ¶
func KeywordField(dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], name string, value []byte) (size uint64)
func TimeField ¶
func TimeField(dst *storage.FieldDefinition, tokPool *pool.Pool[storage.TokenDefinition], name string, t time.Time) (size uint64)
func TokenSize ¶
func TokenSize(t *storage.TokenDefinition) (size uint64)
Types ¶
type Batch ¶
type Batch struct {
DocumentsPool *pool.Pool[storage.Document]
// Read only field computed with each insertion
// Size is computed from the references slices and other values present on all the documents
// Useful as a hard limit to not grow the batch more than e.g: 5GB or so
Size uint64
// List of the documents already present on the batch
Documents []*storage.Document
}
func (*Batch) Insert ¶
func (b *Batch) Insert(id storage.DocumentId, totalFieldsSize uint64, fields ...*storage.FieldDefinition)
Inserts a new document into the batch and updates the size of the batch
Click to show internal directories.
Click to hide internal directories.