Documentation ¶
Index ¶
- Constants
- func Load(data *segment.Data) (segment.Segment, error)
- func Merge(segments []segment.Segment, drops []*roaring.Bitmap, mergeBufferSize int) segment.Merger
- func New(results []segment.Document, normCalc func(string, int) float32) (segment.Segment, uint64, error)
- type CollectionStats
- type DictEntry
- type Dictionary
- func (d *Dictionary) Close() error
- func (d *Dictionary) Contains(key []byte) (bool, error)
- func (d *Dictionary) Iterator(a segment.Automaton, startKeyInclusive, endKeyExclusive []byte) segment.DictionaryIterator
- func (d *Dictionary) PostingsList(term []byte, except *roaring.Bitmap, prealloc segment.PostingsList) (segment.PostingsList, error)
- type DictionaryIterator
- type DocumentValueReader
- type Location
- type Merger
- type Posting
- type PostingsIterator
- func (i *PostingsIterator) ActualBitmap() *roaring.Bitmap
- func (i *PostingsIterator) Advance(docNum uint64) (segment.Posting, error)
- func (i *PostingsIterator) Close() error
- func (i *PostingsIterator) Count() uint64
- func (i *PostingsIterator) DocNum1Hit() (uint64, bool)
- func (i *PostingsIterator) Empty() bool
- func (i *PostingsIterator) Next() (segment.Posting, error)
- func (i *PostingsIterator) ReplaceActual(abm *roaring.Bitmap)
- func (i *PostingsIterator) Size() int
- type PostingsList
- type Segment
- func (s *Segment) CRC() uint32
- func (s *Segment) ChunkMode() uint32
- func (s *Segment) CollectionStats(field string) (segment.CollectionStats, error)
- func (s *Segment) Count() uint64
- func (s *Segment) Dictionary(field string) (segment.Dictionary, error)
- func (s *Segment) DocValueOffset() uint64
- func (s *Segment) DocsMatchingTerms(terms []segment.Term) (*roaring.Bitmap, error)
- func (s *Segment) DocumentValueReader(fields []string) (segment.DocumentValueReader, error)
- func (s *Segment) Fields() []string
- func (s *Segment) FieldsIndexOffset() uint64
- func (s *Segment) NumDocs() uint64
- func (s *Segment) Size() int
- func (s *Segment) StoredIndexOffset() uint64
- func (s *Segment) Type() string
- func (s *Segment) Version() uint32
- func (s *Segment) VisitStoredFields(num uint64, visitor segment.StoredFieldVisitor) error
- func (s *Segment) WriteTo(w io.Writer, _ chan struct{}) (int64, error)
Constants ¶
const Type string = "ice"
const Version uint32 = 1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CollectionStats ¶
type CollectionStats struct {
// contains filtered or unexported fields
}
func (*CollectionStats) DocumentCount ¶
func (c *CollectionStats) DocumentCount() uint64
func (*CollectionStats) Merge ¶
func (c *CollectionStats) Merge(other segment.CollectionStats)
func (*CollectionStats) SumTotalTermFrequency ¶
func (c *CollectionStats) SumTotalTermFrequency() uint64
func (*CollectionStats) TotalDocumentCount ¶
func (c *CollectionStats) TotalDocumentCount() uint64
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary is the representation of the term dictionary
func (*Dictionary) Close ¶
func (d *Dictionary) Close() error
func (*Dictionary) Iterator ¶
func (d *Dictionary) Iterator(a segment.Automaton, startKeyInclusive, endKeyExclusive []byte) segment.DictionaryIterator
Iterator returns an iterator which only visits terms having the the vellum automaton and start/end key range
func (*Dictionary) PostingsList ¶
func (d *Dictionary) PostingsList(term []byte, except *roaring.Bitmap, prealloc segment.PostingsList) (segment.PostingsList, error)
PostingsList returns the postings list for the specified term
type DictionaryIterator ¶
type DictionaryIterator struct {
// contains filtered or unexported fields
}
DictionaryIterator is an iterator for term dictionary
func (*DictionaryIterator) Close ¶
func (i *DictionaryIterator) Close() error
func (*DictionaryIterator) Next ¶
func (i *DictionaryIterator) Next() (segment.DictionaryEntry, error)
Next returns the next entry in the dictionary
type DocumentValueReader ¶
type DocumentValueReader struct {
// contains filtered or unexported fields
}
func (*DocumentValueReader) VisitDocumentValues ¶
func (d *DocumentValueReader) VisitDocumentValues(number uint64, visitor segment.DocumentValueVisitor) error
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
Location represents the location of a single occurrence
func (*Location) Field ¶
Field returns the name of the field (useful in composite fields to know which original field the value came from)
type Merger ¶
type Merger struct {
// contains filtered or unexported fields
}
func (*Merger) DocumentNumbers ¶
type Posting ¶
type Posting struct {
// contains filtered or unexported fields
}
Posting is a single entry in a postings list
func (*Posting) Frequency ¶
Frequency returns the frequencies of occurrence of this term in this doc/field
type PostingsIterator ¶
type PostingsIterator struct { Actual roaring.IntPeekable ActualBM *roaring.Bitmap // contains filtered or unexported fields }
PostingsIterator provides a way to iterate through the postings list
func (*PostingsIterator) ActualBitmap ¶
func (i *PostingsIterator) ActualBitmap() *roaring.Bitmap
ActualBitmap returns the underlying actual bitmap which can be used up the stack for optimizations
func (*PostingsIterator) Advance ¶
func (i *PostingsIterator) Advance(docNum uint64) (segment.Posting, error)
Advance returns the posting at the specified docNum or it is not present the next posting, or if the end is reached, nil
func (*PostingsIterator) Close ¶
func (i *PostingsIterator) Close() error
func (*PostingsIterator) Count ¶
func (i *PostingsIterator) Count() uint64
func (*PostingsIterator) DocNum1Hit ¶
func (i *PostingsIterator) DocNum1Hit() (uint64, bool)
DocNum1Hit returns the docNum and true if this is "1-hit" optimized and the docNum is available.
func (*PostingsIterator) Empty ¶
func (i *PostingsIterator) Empty() bool
func (*PostingsIterator) Next ¶
func (i *PostingsIterator) Next() (segment.Posting, error)
Next returns the next posting on the postings list, or nil at the end
func (*PostingsIterator) ReplaceActual ¶
func (i *PostingsIterator) ReplaceActual(abm *roaring.Bitmap)
ReplaceActual replaces the ActualBM with the provided bitmap
func (*PostingsIterator) Size ¶
func (i *PostingsIterator) Size() int
type PostingsList ¶
type PostingsList struct {
// contains filtered or unexported fields
}
PostingsList is an in-memory representation of a postings list
func (*PostingsList) Count ¶
func (p *PostingsList) Count() uint64
Count returns the number of items on this postings list
func (*PostingsList) Iterator ¶
func (p *PostingsList) Iterator(includeFreq, includeNorm, includeLocs bool, prealloc segment.PostingsIterator) (segment.PostingsIterator, error)
Iterator returns an iterator for this postings list
func (*PostingsList) OrInto ¶
func (p *PostingsList) OrInto(receiver *roaring.Bitmap)
func (*PostingsList) Size ¶
func (p *PostingsList) Size() int
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
func (*Segment) CollectionStats ¶
func (s *Segment) CollectionStats(field string) (segment.CollectionStats, error)
func (*Segment) Dictionary ¶
func (s *Segment) Dictionary(field string) (segment.Dictionary, error)
DictionaryReader returns the term dictionary for the specified field
func (*Segment) DocValueOffset ¶
DocValueOffset returns the docValue offset in the file footer
func (*Segment) DocsMatchingTerms ¶
func (*Segment) DocumentValueReader ¶
func (s *Segment) DocumentValueReader(fields []string) (segment.DocumentValueReader, error)
func (*Segment) FieldsIndexOffset ¶
FieldsIndexOffset returns the fields index offset in the file footer
func (*Segment) StoredIndexOffset ¶
StoredIndexOffset returns the stored value index offset in the file footer
func (*Segment) VisitStoredFields ¶
func (s *Segment) VisitStoredFields(num uint64, visitor segment.StoredFieldVisitor) error
VisitStoredFields invokes the DocFieldValueVistor for each stored field for the specified doc number