Versions in this module Expand all Collapse all v1 v1.1.7 Aug 25, 2024 Changes in this version + const EventKindBatchIntroduction + const EventKindBatchIntroductionStart + const EventKindClose + const EventKindCloseStart + const EventKindMergeTaskIntroduction + const EventKindMergeTaskIntroductionStart + const EventKindMergerProgress + const EventKindPersisterProgress + const ItemKindSegment + const ItemKindSnapshot + func LoadMMapAlways(f lock.LockedFile) (*segment.Data, io.Closer, error) + func LoadMMapNever(f lock.LockedFile) (*segment.Data, io.Closer, error) + type Batch struct + func NewBatch() *Batch + func (b *Batch) Delete(id segment.Term) + func (b *Batch) Insert(doc segment.Document) + func (b *Batch) PersistedCallback() func(error) + func (b *Batch) Reset() + func (b *Batch) SetPersistedCallback(f func(error)) + func (b *Batch) Update(id segment.Term, doc segment.Document) + type Config struct + AnalysisChan chan func() + AsyncError func(error) + DeletionPolicyFunc func() DeletionPolicy + DirectoryFunc func() Directory + EventCallback func(Event) + FilterTimeMax int64 + FilterTimeMin int64 + GoFunc func(func()) + MemoryPressurePauseThreshold int + MergeBufferSize int + MergePlanOptions mergeplan.Options + MinSegmentsForInMemoryMerge int + NormCalc func(string, int) float32 + NumAnalysisWorkers int + OptimizeConjunction bool + OptimizeConjunctionUnadorned bool + OptimizeDisjunctionUnadorned bool + PersisterNapTimeMSec int + PersisterNapUnderNumFiles int + SegmentType string + SegmentVersion uint32 + UnsafeBatch bool + ValidateSnapshotCRC bool + func DefaultConfig(path string) Config + func DefaultConfigWithDirectory(df func() Directory) Config + func InMemoryOnlyConfig() Config + func (config Config) DisableOptimizeConjunction() Config + func (config Config) DisableOptimizeConjunctionUnadorned() Config + func (config Config) DisableOptimizeDisjunctionUnadorned() Config + func (config Config) WithNormCalc(calc func(field string, numTerms int) float32) Config + func (config Config) WithPersisterNapTimeMSec(napTime int) Config + func (config Config) WithSegmentPlugin(plugin *SegmentPlugin) Config + func (config Config) WithSegmentType(typ string) Config + func (config Config) WithSegmentVersion(ver uint32) Config + func (config Config) WithTimeRange(min, max int64) Config + func (config Config) WithUnsafeBatches() Config + func (config Config) WithVirtualField(field segment.Field) Config + type DeletionPolicy interface + Cleanup func(Directory) error + Commit func(snapshot *Snapshot) + type Directory interface + List func(kind string) ([]uint64, error) + Load func(kind string, id uint64) (*segment.Data, io.Closer, error) + Lock func() error + Persist func(kind string, id uint64, w WriterTo, closeCh chan struct{}) error + Remove func(kind string, id uint64) error + Setup func(readOnly bool) error + Stats func() (numItems uint64, numBytes uint64) + Sync func() error + Unlock func() error + type Event struct + Chill *Writer + Duration time.Duration + Kind int + type FileSystemDirectory struct + func NewFileSystemDirectory(path string) *FileSystemDirectory + func (d *FileSystemDirectory) List(kind string) ([]uint64, error) + func (d *FileSystemDirectory) Load(kind string, id uint64) (*segment.Data, io.Closer, error) + func (d *FileSystemDirectory) Lock() error + func (d *FileSystemDirectory) Persist(kind string, id uint64, w WriterTo, closeCh chan struct{}) error + func (d *FileSystemDirectory) Remove(kind string, id uint64) error + func (d *FileSystemDirectory) SetLoadMMapFunc(f LoadMMapFunc) + func (d *FileSystemDirectory) Setup(readOnly bool) error + func (d *FileSystemDirectory) Stats() (numFilesOnDisk, numBytesUsedDisk uint64) + func (d *FileSystemDirectory) Sync() error + func (d *FileSystemDirectory) Unlock() error + type InMemoryDirectory struct + func NewInMemoryDirectory() *InMemoryDirectory + func (d *InMemoryDirectory) List(kind string) ([]uint64, error) + func (d *InMemoryDirectory) Load(kind string, id uint64) (*segment.Data, io.Closer, error) + func (d *InMemoryDirectory) Lock() error + func (d *InMemoryDirectory) Persist(kind string, id uint64, w WriterTo, closeCh chan struct{}) error + func (d *InMemoryDirectory) Remove(kind string, id uint64) error + func (d *InMemoryDirectory) Setup(readOnly bool) error + func (d *InMemoryDirectory) Stats() (numItems, numBytes uint64) + func (d *InMemoryDirectory) Sync() error + func (d *InMemoryDirectory) Unlock() error + type KeepNLatestDeletionPolicy struct + func NewKeepNLatestDeletionPolicy(n int) *KeepNLatestDeletionPolicy + func (p *KeepNLatestDeletionPolicy) Cleanup(dir Directory) error + func (p *KeepNLatestDeletionPolicy) Commit(snapshot *Snapshot) + type LoadMMapFunc func(f lock.LockedFile) (*segment.Data, io.Closer, error) + type SegmentPlugin struct + Load func(*segment.Data) (segment.Segment, error) + Merge func([]segment.Segment, []*roaring.Bitmap, int) segment.Merger + New func(results []segment.Document, normCalc func(string, int) float32) (segment.Segment, uint64, error) + Type string + Version uint32 + type SegmentSnapshot interface + Deleted func() *roaring.Bitmap + DocNum func() uint64 + ID func() uint64 + SegmentSize func() uint64 + Timestamp func() (int64, int64) + type Snapshot struct + func OpenReader(config Config) (*Snapshot, error) + func (i *Snapshot) Backup(remote Directory, cancel chan struct{}) error + func (i *Snapshot) Close() error + func (i *Snapshot) CollectionStats(field string) (segment.CollectionStats, error) + func (i *Snapshot) Count() (uint64, error) + func (i *Snapshot) DictionaryIterator(field string, automaton segment.Automaton, start, end []byte) (segment.DictionaryIterator, error) + func (i *Snapshot) DictionaryLookup(field string) (segment.DictionaryLookup, error) + func (i *Snapshot) DocumentValueReader(fields []string) (segment.DocumentValueReader, error) + func (i *Snapshot) Fields() ([]string, error) + func (i *Snapshot) PostingsIterator(term []byte, field string, includeFreq, includeNorm, includeTermVectors bool) (segment.PostingsIterator, error) + func (i *Snapshot) ReadFrom(r io.Reader) (int64, error) + func (i *Snapshot) Segments() []SegmentSnapshot + func (i *Snapshot) Size() int + func (i *Snapshot) VisitStoredFields(number uint64, visitor segment.StoredFieldVisitor) error + func (i *Snapshot) WriteTo(w io.Writer, _ chan struct{}) (int64, error) + type Stats struct + CurFilesIneligibleForRemoval uint64 + CurOnDiskBytes uint64 + CurOnDiskBytesUsedByRoot uint64 + CurOnDiskFiles uint64 + CurRootEpoch uint64 + LastMergedEpoch uint64 + LastPersistedEpoch uint64 + MaxBatchIntroTime uint64 + MaxFileMergeZapIntroductionTime uint64 + MaxFileMergeZapTime uint64 + MaxMemMergeZapTime uint64 + TotAnalysisTime uint64 + TotBatchIntroTime uint64 + TotBatches uint64 + TotBatchesEmpty uint64 + TotDeletes uint64 + TotEventFired uint64 + TotEventReturned uint64 + TotFileMergeIntroductions uint64 + TotFileMergeIntroductionsDone uint64 + TotFileMergeIntroductionsObsoleted uint64 + TotFileMergeIntroductionsSkipped uint64 + TotFileMergeLoopBeg uint64 + TotFileMergeLoopEnd uint64 + TotFileMergeLoopErr uint64 + TotFileMergePlan uint64 + TotFileMergePlanErr uint64 + TotFileMergePlanNone uint64 + TotFileMergePlanOk uint64 + TotFileMergePlanTasks uint64 + TotFileMergePlanTasksDone uint64 + TotFileMergePlanTasksErr uint64 + TotFileMergePlanTasksSegments uint64 + TotFileMergePlanTasksSegmentsEmpty uint64 + TotFileMergeSegments uint64 + TotFileMergeSegmentsEmpty uint64 + TotFileMergeWrittenBytes uint64 + TotFileMergeZapBeg uint64 + TotFileMergeZapEnd uint64 + TotFileMergeZapIntroductionTime uint64 + TotFileMergeZapTime uint64 + TotFileSegmentsAtRoot uint64 + TotIndexTime uint64 + TotIndexedPlainTextBytes uint64 + TotIntroduceLoop uint64 + TotIntroduceMergeBeg uint64 + TotIntroduceMergeEnd uint64 + TotIntroducePersistBeg uint64 + TotIntroducePersistEnd uint64 + TotIntroduceRevertBeg uint64 + TotIntroduceRevertEnd uint64 + TotIntroduceSegmentBeg uint64 + TotIntroduceSegmentEnd uint64 + TotIntroducedItems uint64 + TotIntroducedSegmentsBatch uint64 + TotIntroducedSegmentsMerge uint64 + TotItemsToPersist uint64 + TotMemMergeBeg uint64 + TotMemMergeDone uint64 + TotMemMergeErr uint64 + TotMemMergeSegments uint64 + TotMemMergeZapBeg uint64 + TotMemMergeZapEnd uint64 + TotMemMergeZapTime uint64 + TotMemorySegmentsAtRoot uint64 + TotOnErrors uint64 + TotPersistLoopBeg uint64 + TotPersistLoopEnd uint64 + TotPersistLoopErr uint64 + TotPersistLoopProgress uint64 + TotPersistLoopWait uint64 + TotPersistLoopWaitNotified uint64 + TotPersistedItems uint64 + TotPersistedSegments uint64 + TotPersisterMergerNapBreak uint64 + TotPersisterNapPauseCompleted uint64 + TotPersisterSlowMergerPause uint64 + TotPersisterSlowMergerResume uint64 + TotSnapshotsRemovedFromMetaStore uint64 + TotTermSearchersFinished uint64 + TotTermSearchersStarted uint64 + TotUpdates uint64 + type Writer struct + func OpenWriter(config Config) (*Writer, error) + func (s *Writer) Batch(batch *Batch) (err error) + func (s *Writer) Close() (err error) + func (s *Writer) DirectoryStats() (numFilesOnDisk, numBytesUsedDisk uint64) + func (s *Writer) MemoryUsed() (memUsed uint64) + func (s *Writer) Reader() (*Snapshot, error) + func (s *Writer) Stats() Stats + type WriterOffline struct + func OpenOfflineWriter(config Config) (writer *WriterOffline, err error) + func (s *WriterOffline) Batch(batch *Batch) (err error) + func (s *WriterOffline) Close() error + type WriterTo interface + WriteTo func(w io.Writer, closeCh chan struct{}) (n int64, err error)