Documentation ¶
Index ¶
- type Dictionary
- func (d *Dictionary) Iterator() segment.DictionaryIterator
- func (d *Dictionary) PostingsList(term string, except *roaring.Bitmap) (segment.PostingsList, error)
- func (d *Dictionary) PrefixIterator(prefix string) segment.DictionaryIterator
- func (d *Dictionary) RangeIterator(start, end string) segment.DictionaryIterator
- type DictionaryIterator
- type Location
- type Posting
- type PostingsIterator
- type PostingsList
- type Segment
- func (s *Segment) AddRef()
- func (s *Segment) Close() error
- func (s *Segment) Count() uint64
- func (s *Segment) DecRef() error
- func (s *Segment) Dictionary(field string) (segment.TermDictionary, error)
- func (s *Segment) DocNumbers(ids []string) (*roaring.Bitmap, error)
- func (s *Segment) Fields() []string
- func (s *Segment) SizeInBytes() uint64
- func (s *Segment) VisitDocument(num uint64, visitor segment.DocumentFieldValueVisitor) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary is the in-memory representation of the term dictionary
func (*Dictionary) Iterator ¶
func (d *Dictionary) Iterator() segment.DictionaryIterator
Iterator returns an iterator for this dictionary
func (*Dictionary) PostingsList ¶
func (d *Dictionary) PostingsList(term string, except *roaring.Bitmap) (segment.PostingsList, error)
PostingsList returns the postings list for the specified term
func (*Dictionary) PrefixIterator ¶
func (d *Dictionary) PrefixIterator(prefix string) segment.DictionaryIterator
PrefixIterator returns an iterator which only visits terms having the the specified prefix
func (*Dictionary) RangeIterator ¶
func (d *Dictionary) RangeIterator(start, end string) segment.DictionaryIterator
RangeIterator returns an iterator which only visits terms between the start and end terms. NOTE: bleve.index API specifies the end is inclusive.
type DictionaryIterator ¶
type DictionaryIterator struct {
// contains filtered or unexported fields
}
DictionaryIterator is an iterator for term dictionary
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
Location represents the location of a single occurance
func (*Location) ArrayPositions ¶
ArrayPositions returns the array position vector associated with this occurance
func (*Location) Field ¶
Field returns the name of the field (useful in composite fields to know which original field the value came from)
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 frequence of occurance of this term in this doc/field
type PostingsIterator ¶
type PostingsIterator struct {
// contains filtered or unexported fields
}
PostingsIterator provides a way to iterate through the postings list
type PostingsList ¶
type PostingsList struct {
// contains filtered or unexported fields
}
PostingsList is an in-memory represenation 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() segment.PostingsIterator
Iterator returns an iterator for this postings list
type Segment ¶
type Segment struct { // FieldsMap adds 1 to field id to avoid zero value issues // name -> field id + 1 FieldsMap map[string]uint16 // FieldsInv is the inverse of FieldsMap // field id -> name FieldsInv []string // Term dictionaries for each field // field id -> term -> postings list id + 1 Dicts []map[string]uint64 // Terms for each field, where terms are sorted ascending // field id -> []term DictKeys [][]string // Postings list // postings list id -> bitmap by docNum Postings []*roaring.Bitmap // Postings list has locations PostingsLocs []*roaring.Bitmap // Term frequencies // postings list id -> Freqs (one for each hit in bitmap) Freqs [][]uint64 // Field norms // postings list id -> Norms (one for each hit in bitmap) Norms [][]float32 // Field/start/end/pos/locarraypos // postings list id -> start/end/pos/locarraypos (one for each freq) Locfields [][]uint16 Locstarts [][]uint64 Locends [][]uint64 Locpos [][]uint64 Locarraypos [][][]uint64 // Stored field values // docNum -> field id -> slice of values (each value []byte) Stored []map[uint16][][]byte // Stored field types // docNum -> field id -> slice of types (each type byte) StoredTypes []map[uint16][]byte // Stored field array positions // docNum -> field id -> slice of array positions (each is []uint64) StoredPos []map[uint16][][]uint64 // For storing the docValue persisted fields DocValueFields map[uint16]bool // contains filtered or unexported fields }
Segment is an in memory implementation of scorch.Segment
func NewFromAnalyzedDocs ¶
func NewFromAnalyzedDocs(results []*index.AnalysisResult) *Segment
NewFromAnalyzedDocs places the analyzed document mutations into a new segment
func (*Segment) Count ¶
Count returns the number of documents in this segment (this has no notion of deleted docs)
func (*Segment) Dictionary ¶
func (s *Segment) Dictionary(field string) (segment.TermDictionary, error)
Dictionary returns the term dictionary for the specified field
func (*Segment) DocNumbers ¶
DocNumbers returns a bitset corresponding to the doc numbers of all the provided _id strings
func (*Segment) SizeInBytes ¶
func (*Segment) VisitDocument ¶
func (s *Segment) VisitDocument(num uint64, visitor segment.DocumentFieldValueVisitor) error
VisitDocument invokes the DocFieldValueVistor for each stored field for the specified doc number