bleve

package
v1.23.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 15 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 GuessFuzzinessByKeyword added in v1.22.0

func GuessFuzzinessByKeyword(s string) int

This method test the GuessFuzzinessByKeyword method. The fuzziness is based on the levenshtein distance and determines how many chars may be different on two string and they still be considered equivalent. Given a phrasse, its shortest word determines its fuzziness. If a phrase uses CJK (eg: `갃갃갃` `啊啊啊`), the fuzziness is zero.

func MatchPhraseQuery

func MatchPhraseQuery(matchPhrase, field, analyzer string, fuzziness int) *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(minOption, maxOption optional.Option[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