bleve

package
v1.21.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolFieldQuery

func BoolFieldQuery(value bool, field string) *query.BoolFieldQuery

BoolFieldQuery generates a bool field query for the given value and field

func MatchPhraseQuery

func MatchPhraseQuery(matchPhrase, field, analyzer string) *query.MatchPhraseQuery

MatchPhraseQuery generates a match phrase query for the given phrase, field and analyzer

func NumericEqualityQuery

func NumericEqualityQuery(value int64, field string) *query.NumericRangeQuery

NumericEqualityQuery generates a numeric equality query for the given value and field

func NumericRangeInclusiveQuery

func NumericRangeInclusiveQuery(min, max *int64, field string) *query.NumericRangeQuery

Types

type FlushingBatch

type FlushingBatch struct {
	// contains filtered or unexported fields
}

FlushingBatch is a batch of operations that automatically flushes to the underlying index once it reaches a certain size.

func NewFlushingBatch

func NewFlushingBatch(index bleve.Index, maxBatchSize int) *FlushingBatch

NewFlushingBatch creates a new flushing batch for the specified index. Once the number of operations in the batch reaches the specified limit, the batch automatically flushes its operations to the index.

func (*FlushingBatch) Delete

func (b *FlushingBatch) Delete(id string) error

Delete add a delete index to batch

func (*FlushingBatch) Flush

func (b *FlushingBatch) Flush() error

Flush submit the batch and create a new one

func (*FlushingBatch) Index

func (b *FlushingBatch) Index(id string, data any) error

Index add a new index to batch

type Indexer

type Indexer struct {
	Indexer bleve.Index
	// contains filtered or unexported fields
}

Indexer represents a basic bleve indexer implementation

func NewIndexer

func NewIndexer(indexDir string, version int, mappingGetter func() (mapping.IndexMapping, error)) *Indexer

func (*Indexer) Close

func (i *Indexer) Close()

func (*Indexer) Init

func (i *Indexer) Init(_ context.Context) (bool, error)

Init initializes the indexer

func (*Indexer) Ping

func (i *Indexer) Ping(_ context.Context) error

Ping checks if the indexer is available

type MappingGetter

type MappingGetter func() (mapping.IndexMapping, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL