Versions in this module Expand all Collapse all v0 v0.8.1 Sep 20, 2019 Changes in this version + const Name + const Version + var DefaultChunkFactor uint32 = 1024 + var DefaultMemoryPressurePauseThreshold uint64 = math.MaxUint64 + var DefaultMinSegmentsForInMemoryMerge = 2 + var DefaultPersisterNapTimeMSec int = 0 + var DefaultPersisterNapUnderNumFiles int = 1000 + var ErrClosed = fmt.Errorf("scorch closed") + var EventKindBatchIntroduction = EventKind(6) + var EventKindBatchIntroductionStart = EventKind(5) + var EventKindClose = EventKind(2) + var EventKindCloseStart = EventKind(1) + var EventKindMergerProgress = EventKind(3) + var EventKindPersisterProgress = EventKind(4) + var NumSnapshotsToKeep = 1 + var OptimizeConjunction = true + var OptimizeConjunctionUnadorned = true + var OptimizeDisjunctionUnadorned = true + var OptimizeDisjunctionUnadornedMinChildCardinality = uint64(256) + var OptimizeTFRConjunctionUnadornedField = "*" + var OptimizeTFRConjunctionUnadornedTerm = []byte("<conjunction:unadorned>") + var OptimizeTFRDisjunctionUnadornedField = "*" + var OptimizeTFRDisjunctionUnadornedTerm = []byte("<disjunction:unadorned>") + var RegistryAsyncErrorCallbacks = map[string]func(error) + var RegistryEventCallbacks = map[string]func(Event) + var TermSeparator byte = 0xff + var TermSeparatorSplitSlice = []byte + func NewScorch(storeName string, config map[string]interface{}, ...) (index.Index, error) + type DocValueReader struct + func (dvr *DocValueReader) VisitDocValues(id index.IndexInternalID, visitor index.DocumentFieldTermVisitor) (err error) + type Event struct + Duration time.Duration + Kind EventKind + Scorch *Scorch + type EventKind int + type IndexSnapshot struct + func (i *IndexSnapshot) AddRef() + func (i *IndexSnapshot) Close() error + func (i *IndexSnapshot) DecRef() (err error) + func (i *IndexSnapshot) DocCount() (uint64, error) + func (i *IndexSnapshot) DocIDReaderAll() (index.DocIDReader, error) + func (i *IndexSnapshot) DocIDReaderOnly(ids []string) (index.DocIDReader, error) + func (i *IndexSnapshot) DocValueReader(fields []string) (index.DocValueReader, error) + func (i *IndexSnapshot) Document(id string) (rv *document.Document, err error) + func (i *IndexSnapshot) DocumentVisitFieldTerms(id index.IndexInternalID, fields []string, ...) error + func (i *IndexSnapshot) DumpAll() chan interface{} + func (i *IndexSnapshot) DumpDoc(id string) chan interface{} + func (i *IndexSnapshot) DumpFields() chan interface{} + func (i *IndexSnapshot) ExternalID(id index.IndexInternalID) (string, error) + func (i *IndexSnapshot) FieldDict(field string) (index.FieldDict, error) + func (i *IndexSnapshot) FieldDictContains(field string) (index.FieldDictContains, error) + func (i *IndexSnapshot) FieldDictFuzzy(field string, term string, fuzziness int, prefix string) (index.FieldDict, error) + func (i *IndexSnapshot) FieldDictOnly(field string, onlyTerms [][]byte, includeCount bool) (index.FieldDict, error) + func (i *IndexSnapshot) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error) + func (i *IndexSnapshot) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error) + func (i *IndexSnapshot) FieldDictRegexp(field string, termRegex string) (index.FieldDict, error) + func (i *IndexSnapshot) Fields() ([]string, error) + func (i *IndexSnapshot) GetInternal(key []byte) ([]byte, error) + func (i *IndexSnapshot) Internal() map[string][]byte + func (i *IndexSnapshot) InternalID(id string) (rv index.IndexInternalID, err error) + func (i *IndexSnapshot) Segments() []*SegmentSnapshot + func (i *IndexSnapshot) Size() int + func (i *IndexSnapshot) TermFieldReader(term []byte, field string, includeFreq, includeNorm, includeTermVectors bool) (index.TermFieldReader, error) + type IndexSnapshotDocIDReader struct + func (i *IndexSnapshotDocIDReader) Advance(ID index.IndexInternalID) (index.IndexInternalID, error) + func (i *IndexSnapshotDocIDReader) Close() error + func (i *IndexSnapshotDocIDReader) Next() (index.IndexInternalID, error) + func (i *IndexSnapshotDocIDReader) Size() int + type IndexSnapshotFieldDict struct + func (i *IndexSnapshotFieldDict) Close() error + func (i *IndexSnapshotFieldDict) Contains(key []byte) (bool, error) + func (i *IndexSnapshotFieldDict) Len() int + func (i *IndexSnapshotFieldDict) Less(a, b int) bool + func (i *IndexSnapshotFieldDict) Next() (*index.DictEntry, error) + func (i *IndexSnapshotFieldDict) Pop() interface{} + func (i *IndexSnapshotFieldDict) Push(x interface{}) + func (i *IndexSnapshotFieldDict) Swap(a, b int) + type IndexSnapshotTermFieldReader struct + func (i *IndexSnapshotTermFieldReader) Advance(ID index.IndexInternalID, preAlloced *index.TermFieldDoc) (*index.TermFieldDoc, error) + func (i *IndexSnapshotTermFieldReader) Close() error + func (i *IndexSnapshotTermFieldReader) Count() uint64 + func (i *IndexSnapshotTermFieldReader) Next(preAlloced *index.TermFieldDoc) (*index.TermFieldDoc, error) + func (i *IndexSnapshotTermFieldReader) Size() int + func (s *IndexSnapshotTermFieldReader) Optimize(kind string, octx index.OptimizableContext) (index.OptimizableContext, error) + type OptimizeTFRConjunction struct + func (o *OptimizeTFRConjunction) Finish() (index.Optimized, error) + type OptimizeTFRConjunctionUnadorned struct + func (o *OptimizeTFRConjunctionUnadorned) Finish() (rv index.Optimized, err error) + type OptimizeTFRDisjunctionUnadorned struct + func (o *OptimizeTFRDisjunctionUnadorned) Finish() (rv index.Optimized, err error) + type RollbackPoint struct + func (r *RollbackPoint) GetInternal(key []byte) []byte + type Scorch struct + func (s *Scorch) AddEligibleForRemoval(epoch uint64) + func (s *Scorch) Advanced() (store.KVStore, error) + func (s *Scorch) Analyze(d *document.Document) *index.AnalysisResult + func (s *Scorch) Batch(batch *index.Batch) (err error) + func (s *Scorch) Close() (err error) + func (s *Scorch) Delete(id string) error + func (s *Scorch) DeleteInternal(key []byte) error + func (s *Scorch) LoadSnapshot(epoch uint64) (rv *IndexSnapshot, err error) + func (s *Scorch) MemoryUsed() (memUsed uint64) + func (s *Scorch) Open() error + func (s *Scorch) Reader() (index.IndexReader, error) + func (s *Scorch) ReportBytesWritten(bytesWritten uint64) + func (s *Scorch) Rollback(to *RollbackPoint) error + func (s *Scorch) RollbackPoints() ([]*RollbackPoint, error) + func (s *Scorch) RootBoltSnapshotEpochs() ([]uint64, error) + func (s *Scorch) SetInternal(key, val []byte) error + func (s *Scorch) Stats() json.Marshaler + func (s *Scorch) StatsMap() map[string]interface{} + func (s *Scorch) Update(doc *document.Document) error + type SegmentSnapshot struct + func (s *SegmentSnapshot) Close() error + func (s *SegmentSnapshot) Count() uint64 + func (s *SegmentSnapshot) Deleted() *roaring.Bitmap + func (s *SegmentSnapshot) DocID(num uint64) ([]byte, error) + func (s *SegmentSnapshot) DocNumbers(docIDs []string) (*roaring.Bitmap, error) + func (s *SegmentSnapshot) DocNumbersLive() *roaring.Bitmap + func (s *SegmentSnapshot) Fields() []string + func (s *SegmentSnapshot) FullSize() int64 + func (s *SegmentSnapshot) Id() uint64 + func (s *SegmentSnapshot) Segment() segment.Segment + func (s *SegmentSnapshot) Size() (rv int) + func (s *SegmentSnapshot) VisitDocument(num uint64, visitor segment.DocumentFieldValueVisitor) error + func (s SegmentSnapshot) LiveSize() int64 + type Stats struct + CurFilesIneligibleForRemoval uint64 + CurRootEpoch uint64 + LastMergedEpoch uint64 + LastPersistedEpoch uint64 + MaxBatchIntroTime uint64 + MaxFileMergeZapTime uint64 + MaxMemMergeZapTime uint64 + TotAnalysisTime uint64 + TotBatchIntroTime uint64 + TotBatches uint64 + TotBatchesEmpty uint64 + TotDeletes uint64 + TotFileMergeIntroductions uint64 + TotFileMergeIntroductionsDone 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 + 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 + func (s *Stats) MarshalJSON() ([]byte, error) + func (s *Stats) ToMap() map[string]interface{}