bleve: Index | Files | Directories

package segment

import ""


Package Files

empty.go int.go regexp.go segment.go


const (
    MaxVarintSize = 9

    // IntMin is chosen such that the range of int tags does not overlap the
    // ascii character set that is frequently used in testing.
    IntMin = 0x80 // 128

    // IntMax is the maximum int tag value.
    IntMax = 0xfd // 253


var AnEmptyPostingsIterator = &EmptyPostingsIterator{}
var ErrClosed = fmt.Errorf("index closed")
var ErrMemUvarintReaderOverflow = errors.New("MemUvarintReader overflow")

func DecodeUvarintAscending Uses

func DecodeUvarintAscending(b []byte) ([]byte, uint64, error)

DecodeUvarintAscending decodes a varint encoded uint64 from the input buffer. The remainder of the input buffer and the decoded uint64 are returned.

func EncodeUvarintAscending Uses

func EncodeUvarintAscending(b []byte, v uint64) []byte

EncodeUvarintAscending encodes the uint64 value using a variable length (length-prefixed) representation. The length is encoded as a single byte indicating the number of encoded bytes (-8) to follow. See EncodeVarintAscending for rationale. The encoded bytes are appended to the supplied buffer and the final buffer is returned.

func IncrementBytes Uses

func IncrementBytes(in []byte) []byte

func LiteralPrefix Uses

func LiteralPrefix(s *syntax.Regexp) string

Returns the literal prefix given the parse tree for a regexp

func ParseRegexp Uses

func ParseRegexp(pattern string) (a *regexp.Regexp, prefixBeg, prefixEnd []byte, err error)

type DictionaryIterator Uses

type DictionaryIterator interface {
    Next() (*index.DictEntry, error)
    Exists(key []byte) (bool, error)

type DocVisitState Uses

type DocVisitState interface {

type DocumentFieldTermVisitable Uses

type DocumentFieldTermVisitable interface {
    VisitDocumentFieldTerms(localDocNum uint64, fields []string,
        visitor index.DocumentFieldTermVisitor, optional DocVisitState) (DocVisitState, error)

    // VisitableDocValueFields implementation should return
    // the list of fields which are document value persisted and
    // therefore visitable by the above VisitDocumentFieldTerms method.
    VisitableDocValueFields() ([]string, error)

DocumentFieldTermVisitable is implemented by various scorch segment implementations with persistence for the un inverting of the postings or other indexed values.

type DocumentFieldValueVisitor Uses

type DocumentFieldValueVisitor func(field string, typ byte, value []byte, pos []uint64) bool

DocumentFieldValueVisitor defines a callback to be visited for each stored field value. The return value determines if the visitor should keep going. Returning true continues visiting, false stops.

type EmptyDictionary Uses

type EmptyDictionary struct{}

func (*EmptyDictionary) AutomatonIterator Uses

func (e *EmptyDictionary) AutomatonIterator(a vellum.Automaton,
    startKeyInclusive, endKeyExclusive []byte) DictionaryIterator

func (*EmptyDictionary) ExistsIterator Uses

func (e *EmptyDictionary) ExistsIterator() DictionaryIterator

func (*EmptyDictionary) Iterator Uses

func (e *EmptyDictionary) Iterator() DictionaryIterator

func (*EmptyDictionary) OnlyIterator Uses

func (e *EmptyDictionary) OnlyIterator(onlyTerms [][]byte,
    includeCount bool) DictionaryIterator

func (*EmptyDictionary) PostingsList Uses

func (e *EmptyDictionary) PostingsList(term []byte,
    except *roaring.Bitmap, prealloc PostingsList) (PostingsList, error)

func (*EmptyDictionary) PrefixIterator Uses

func (e *EmptyDictionary) PrefixIterator(prefix string) DictionaryIterator

func (*EmptyDictionary) RangeIterator Uses

func (e *EmptyDictionary) RangeIterator(start, end string) DictionaryIterator

type EmptyDictionaryIterator Uses

type EmptyDictionaryIterator struct{}

func (*EmptyDictionaryIterator) Exists Uses

func (e *EmptyDictionaryIterator) Exists(key []byte) (bool, error)

func (*EmptyDictionaryIterator) Next Uses

func (e *EmptyDictionaryIterator) Next() (*index.DictEntry, error)

type EmptyPostingsIterator Uses

type EmptyPostingsIterator struct{}

func (*EmptyPostingsIterator) Advance Uses

func (e *EmptyPostingsIterator) Advance(uint64) (Posting, error)

func (*EmptyPostingsIterator) Next Uses

func (e *EmptyPostingsIterator) Next() (Posting, error)

func (*EmptyPostingsIterator) Size Uses

func (e *EmptyPostingsIterator) Size() int

type EmptyPostingsList Uses

type EmptyPostingsList struct{}

func (*EmptyPostingsList) Count Uses

func (e *EmptyPostingsList) Count() uint64

func (*EmptyPostingsList) Iterator Uses

func (e *EmptyPostingsList) Iterator(includeFreq, includeNorm, includeLocations bool,
    prealloc PostingsIterator) PostingsIterator

func (*EmptyPostingsList) Size Uses

func (e *EmptyPostingsList) Size() int

type EmptySegment Uses

type EmptySegment struct{}

func (*EmptySegment) AddRef Uses

func (e *EmptySegment) AddRef()

func (*EmptySegment) Close Uses

func (e *EmptySegment) Close() error

func (*EmptySegment) Count Uses

func (e *EmptySegment) Count() uint64

func (*EmptySegment) DecRef Uses

func (e *EmptySegment) DecRef() error

func (*EmptySegment) Dictionary Uses

func (e *EmptySegment) Dictionary(field string) (TermDictionary, error)

func (*EmptySegment) DocID Uses

func (e *EmptySegment) DocID(num uint64) ([]byte, error)

func (*EmptySegment) DocNumbers Uses

func (e *EmptySegment) DocNumbers([]string) (*roaring.Bitmap, error)

func (*EmptySegment) Fields Uses

func (e *EmptySegment) Fields() []string

func (*EmptySegment) Size Uses

func (e *EmptySegment) Size() uint64

func (*EmptySegment) VisitDocument Uses

func (e *EmptySegment) VisitDocument(num uint64, visitor DocumentFieldValueVisitor) error

type Location Uses

type Location interface {
    Field() string
    Start() uint64
    End() uint64
    Pos() uint64
    ArrayPositions() []uint64
    Size() int

type MemUvarintReader Uses

type MemUvarintReader struct {
    C   int // index of next byte to read from S
    S   []byte

func NewMemUvarintReader Uses

func NewMemUvarintReader(s []byte) *MemUvarintReader

func (*MemUvarintReader) Len Uses

func (r *MemUvarintReader) Len() int

Len returns the number of unread bytes.

func (*MemUvarintReader) ReadUvarint Uses

func (r *MemUvarintReader) ReadUvarint() (uint64, error)

ReadUvarint reads an encoded uint64. The original code this was based on is at encoding/binary/ReadUvarint().

func (*MemUvarintReader) Reset Uses

func (r *MemUvarintReader) Reset(s []byte)

func (*MemUvarintReader) SkipBytes Uses

func (r *MemUvarintReader) SkipBytes(count int)

SkipBytes skips a count number of bytes.

func (*MemUvarintReader) SkipUvarint Uses

func (r *MemUvarintReader) SkipUvarint()

SkipUvarint skips ahead one encoded uint64.

type Posting Uses

type Posting interface {
    Number() uint64

    Frequency() uint64
    Norm() float64

    Locations() []Location

    Size() int

type PostingsIterator Uses

type PostingsIterator interface {
    // The caller is responsible for copying whatever it needs from
    // the returned Posting instance before calling Next(), as some
    // implementations may return a shared instance to reduce memory
    // allocations.
    Next() (Posting, error)

    // Advance will return the posting with the specified doc number
    // or if there is no such posting, the next posting.
    // Callers MUST NOT attempt to pass a docNum that is less than or
    // equal to the currently visited posting doc Num.
    Advance(docNum uint64) (Posting, error)

    Size() int

type PostingsList Uses

type PostingsList interface {
    Iterator(includeFreq, includeNorm, includeLocations bool, prealloc PostingsIterator) PostingsIterator

    Size() int

    Count() uint64

type Segment Uses

type Segment interface {
    Dictionary(field string) (TermDictionary, error)

    VisitDocument(num uint64, visitor DocumentFieldValueVisitor) error

    DocID(num uint64) ([]byte, error)

    Count() uint64

    DocNumbers([]string) (*roaring.Bitmap, error)

    Fields() []string

    Close() error

    Size() int

    DecRef() error

type StatsReporter Uses

type StatsReporter interface {
    ReportBytesWritten(bytesWritten uint64)

type TermDictionary Uses

type TermDictionary interface {
    PostingsList(term []byte, except *roaring.Bitmap, prealloc PostingsList) (PostingsList, error)

    Iterator() DictionaryIterator
    PrefixIterator(prefix string) DictionaryIterator
    RangeIterator(start, end string) DictionaryIterator
    AutomatonIterator(a vellum.Automaton,
        startKeyInclusive, endKeyExclusive []byte) DictionaryIterator
    OnlyIterator(onlyTerms [][]byte, includeCount bool) DictionaryIterator
    ExistsIterator() DictionaryIterator



Package segment imports 7 packages (graph) and is imported by 20 packages. Updated 2019-06-24. Refresh now. Tools for package owners.