Documentation ¶
Index ¶
- func BoolFieldQuery(value bool, field string) *query.BoolFieldQuery
- func GuessFuzzinessByKeyword(s string) int
- func MatchPhraseQuery(matchPhrase, field, analyzer string, fuzziness int) *query.MatchPhraseQuery
- func NumericEqualityQuery(value int64, field string) *query.NumericRangeQuery
- func NumericRangeInclusiveQuery(minOption, maxOption optional.Option[int64], field string) *query.NumericRangeQuery
- type FlushingBatch
- type Indexer
- type MappingGetter
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
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
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
type Indexer ¶
type Indexer struct { Indexer bleve.Index // contains filtered or unexported fields }
Indexer represents a basic bleve indexer implementation
func NewIndexer ¶
type MappingGetter ¶
type MappingGetter func() (mapping.IndexMapping, error)