Documentation
¶
Index ¶
- Variables
- func ComputeGeoRange(ctx context.Context, term uint64, shift uint, ...) (onBoundary [][]byte, notOnBoundary [][]byte, err error)
- func GetAutoFuzziness(term string) int
- func NewAutoFuzzySearcher(ctx context.Context, indexReader index.IndexReader, term string, prefix int, ...) (search.Searcher, error)
- func NewConjunctionSearcher(ctx context.Context, indexReader index.IndexReader, ...) (search.Searcher, error)
- func NewDisjunctionSearcher(ctx context.Context, indexReader index.IndexReader, ...) (search.Searcher, error)
- func NewFuzzySearcher(ctx context.Context, indexReader index.IndexReader, term string, ...) (search.Searcher, error)
- func NewGeoBoundedPolygonSearcher(ctx context.Context, indexReader index.IndexReader, coordinates []geo.Point, ...) (search.Searcher, error)
- func NewGeoBoundingBoxSearcher(ctx context.Context, indexReader index.IndexReader, ...) (search.Searcher, error)
- func NewGeoPointDistanceSearcher(ctx context.Context, indexReader index.IndexReader, ...) (search.Searcher, error)
- func NewGeoShapeSearcher(ctx context.Context, indexReader index.IndexReader, shape index.GeoJSON, ...) (search.Searcher, error)
- func NewIPRangeSearcher(ctx context.Context, indexReader index.IndexReader, ipNet *net.IPNet, ...) (search.Searcher, error)
- func NewMultiTermSearcher(ctx context.Context, indexReader index.IndexReader, terms []string, ...) (search.Searcher, error)
- func NewMultiTermSearcherBoosted(ctx context.Context, indexReader index.IndexReader, terms []string, ...) (search.Searcher, error)
- func NewMultiTermSearcherBytes(ctx context.Context, indexReader index.IndexReader, terms [][]byte, ...) (search.Searcher, error)
- func NewNestedConjunctionSearcher(ctx context.Context, indexReader index.IndexReader, ...) (search.Searcher, error)
- func NewNumericRangeSearcher(ctx context.Context, indexReader index.IndexReader, min *float64, max *float64, ...) (search.Searcher, error)
- func NewRegexpSearcher(ctx context.Context, indexReader index.IndexReader, pattern Regexp, ...) (search.Searcher, error)
- func NewRegexpStringSearcher(ctx context.Context, indexReader index.IndexReader, pattern string, ...) (search.Searcher, error)
- func NewSynonymSearcher(ctx context.Context, indexReader index.IndexReader, term []byte, ...) (search.Searcher, error)
- func NewTermPrefixSearcher(ctx context.Context, indexReader index.IndexReader, prefix string, ...) (search.Searcher, error)
- func NewTermRangeSearcher(ctx context.Context, indexReader index.IndexReader, min, max []byte, ...) (search.Searcher, error)
- func NewTermSearcher(ctx context.Context, indexReader index.IndexReader, term string, field string, ...) (search.Searcher, error)
- func NewTermSearcherBytes(ctx context.Context, indexReader index.IndexReader, term []byte, field string, ...) (search.Searcher, error)
- type BooleanSearcher
- func (s *BooleanSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *BooleanSearcher) Close() error
- func (s *BooleanSearcher) Count() uint64
- func (s *BooleanSearcher) DocumentMatchPoolSize() int
- func (s *BooleanSearcher) Min() int
- func (s *BooleanSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *BooleanSearcher) SetQueryNorm(qnorm float64)
- func (s *BooleanSearcher) Size() int
- func (s *BooleanSearcher) Weight() float64
- type CoalesceQueue
- type ConjunctionSearcher
- func (s *ConjunctionSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *ConjunctionSearcher) Close() (rv error)
- func (s *ConjunctionSearcher) Count() uint64
- func (s *ConjunctionSearcher) DocumentMatchPoolSize() int
- func (s *ConjunctionSearcher) Min() int
- func (s *ConjunctionSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *ConjunctionSearcher) SetQueryNorm(qnorm float64)
- func (s *ConjunctionSearcher) Size() int
- func (s *ConjunctionSearcher) Weight() float64
- type CustomFilterFunc
- type CustomFilterSearcher
- func (f *CustomFilterSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (f *CustomFilterSearcher) Close() error
- func (f *CustomFilterSearcher) Count() uint64
- func (f *CustomFilterSearcher) DocumentMatchPoolSize() int
- func (f *CustomFilterSearcher) Min() int
- func (f *CustomFilterSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (f *CustomFilterSearcher) SetQueryNorm(n float64)
- func (f *CustomFilterSearcher) Size() int
- func (f *CustomFilterSearcher) Weight() float64
- type CustomScoreFunc
- type CustomScoreSearcher
- func (f *CustomScoreSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (f *CustomScoreSearcher) Close() error
- func (f *CustomScoreSearcher) Count() uint64
- func (f *CustomScoreSearcher) DocumentMatchPoolSize() int
- func (f *CustomScoreSearcher) Min() int
- func (f *CustomScoreSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (f *CustomScoreSearcher) SetQueryNorm(n float64)
- func (f *CustomScoreSearcher) Size() int
- func (f *CustomScoreSearcher) Weight() float64
- type DisjunctionHeapSearcher
- func (s *DisjunctionHeapSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *DisjunctionHeapSearcher) Close() (rv error)
- func (s *DisjunctionHeapSearcher) Count() uint64
- func (s *DisjunctionHeapSearcher) DocumentMatchPoolSize() int
- func (s *DisjunctionHeapSearcher) Len() int
- func (s *DisjunctionHeapSearcher) Less(i, j int) bool
- func (s *DisjunctionHeapSearcher) Min() int
- func (s *DisjunctionHeapSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *DisjunctionHeapSearcher) Optimize(kind string, octx index.OptimizableContext) (index.OptimizableContext, error)
- func (s *DisjunctionHeapSearcher) Pop() interface{}
- func (s *DisjunctionHeapSearcher) Push(x interface{})
- func (s *DisjunctionHeapSearcher) SetQueryNorm(qnorm float64)
- func (s *DisjunctionHeapSearcher) Size() int
- func (s *DisjunctionHeapSearcher) Swap(i, j int)
- func (s *DisjunctionHeapSearcher) Weight() float64
- type DisjunctionSliceSearcher
- func (s *DisjunctionSliceSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *DisjunctionSliceSearcher) Close() (rv error)
- func (s *DisjunctionSliceSearcher) Count() uint64
- func (s *DisjunctionSliceSearcher) DocumentMatchPoolSize() int
- func (s *DisjunctionSliceSearcher) Min() int
- func (s *DisjunctionSliceSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *DisjunctionSliceSearcher) Optimize(kind string, octx index.OptimizableContext) (index.OptimizableContext, error)
- func (s *DisjunctionSliceSearcher) SetQueryNorm(qnorm float64)
- func (s *DisjunctionSliceSearcher) Size() int
- func (s *DisjunctionSliceSearcher) Weight() float64
- type DocIDSearcher
- func (s *DocIDSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *DocIDSearcher) Close() error
- func (s *DocIDSearcher) Count() uint64
- func (s *DocIDSearcher) DocumentMatchPoolSize() int
- func (s *DocIDSearcher) Min() int
- func (s *DocIDSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *DocIDSearcher) SetQueryNorm(qnorm float64)
- func (s *DocIDSearcher) Size() int
- func (s *DocIDSearcher) Weight() float64
- type FilterFunc
- type FilteringSearcher
- func (f *FilteringSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (f *FilteringSearcher) Close() error
- func (f *FilteringSearcher) Count() uint64
- func (f *FilteringSearcher) DocumentMatchPoolSize() int
- func (f *FilteringSearcher) Min() int
- func (f *FilteringSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (f *FilteringSearcher) SetQueryNorm(n float64)
- func (f *FilteringSearcher) Size() int
- func (f *FilteringSearcher) Weight() float64
- type MatchAllSearcher
- func (s *MatchAllSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *MatchAllSearcher) Close() error
- func (s *MatchAllSearcher) Count() uint64
- func (s *MatchAllSearcher) DocumentMatchPoolSize() int
- func (s *MatchAllSearcher) Min() int
- func (s *MatchAllSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *MatchAllSearcher) SetQueryNorm(qnorm float64)
- func (s *MatchAllSearcher) Size() int
- func (s *MatchAllSearcher) Weight() float64
- type MatchNoneSearcher
- func (s *MatchNoneSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *MatchNoneSearcher) Close() error
- func (s *MatchNoneSearcher) Count() uint64
- func (s *MatchNoneSearcher) DocumentMatchPoolSize() int
- func (s *MatchNoneSearcher) Min() int
- func (s *MatchNoneSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *MatchNoneSearcher) SetQueryNorm(qnorm float64)
- func (s *MatchNoneSearcher) Size() int
- func (s *MatchNoneSearcher) Weight() float64
- type NestedConjunctionSearcher
- func (s *NestedConjunctionSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *NestedConjunctionSearcher) Close() (rv error)
- func (s *NestedConjunctionSearcher) Count() uint64
- func (s *NestedConjunctionSearcher) DocumentMatchPoolSize() int
- func (s *NestedConjunctionSearcher) Min() int
- func (s *NestedConjunctionSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *NestedConjunctionSearcher) SetQueryNorm(qnorm float64)
- func (s *NestedConjunctionSearcher) Size() int
- func (s *NestedConjunctionSearcher) Weight() float64
- type OrderedPositionalSearcherList
- type OrderedSearcherList
- type PhraseSearcher
- func (s *PhraseSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *PhraseSearcher) Close() error
- func (s *PhraseSearcher) Count() uint64
- func (s *PhraseSearcher) DocumentMatchPoolSize() int
- func (s *PhraseSearcher) Min() int
- func (s *PhraseSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *PhraseSearcher) SetQueryNorm(qnorm float64)
- func (s *PhraseSearcher) Size() int
- func (s *PhraseSearcher) Weight() float64
- type Regexp
- type SearcherCurr
- type TermSearcher
- func (s *TermSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
- func (s *TermSearcher) Close() error
- func (s *TermSearcher) Count() uint64
- func (s *TermSearcher) DocumentMatchPoolSize() int
- func (s *TermSearcher) Min() int
- func (s *TermSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
- func (s *TermSearcher) Optimize(kind string, octx index.OptimizableContext) (index.OptimizableContext, error)
- func (s *TermSearcher) SetQueryNorm(qnorm float64)
- func (s *TermSearcher) Size() int
- func (s *TermSearcher) Weight() float64
Constants ¶
This section is empty.
Variables ¶
var ( GeoBitsShift1 = geo.GeoBits << 1 GeoBitsShift1Minus1 = GeoBitsShift1 - 1 )
var AutoFuzzinessHighThreshold = 5
AutoFuzzinessHighThreshold is the threshold for the term length above which the fuzziness is set to MaxFuzziness when the fuzziness mode is set to AutoFuzziness.
var AutoFuzzinessLowThreshold = 2
AutoFuzzinessLowThreshold is the threshold for the term length below which the fuzziness is set to zero when the fuzziness mode is set to AutoFuzziness. For terms with length between AutoFuzzinessLowThreshold and AutoFuzzinessHighThreshold, the fuzziness is set to MaxFuzziness - 1.
var DisjunctionHeapTakeover = 10
DisjunctionHeapTakeover is a compile time setting that applications can adjust to control when the DisjunctionSearcher will switch from a simple slice implementation to a heap implementation.
var DisjunctionMaxClauseCount = 0
DisjunctionMaxClauseCount is a compile time setting that applications can adjust to non-zero value to cause the DisjunctionSearcher to return an error instead of executing searches when the size exceeds this value.
var MaxFuzziness = 2
Functions ¶
func ComputeGeoRange ¶
func GetAutoFuzziness ¶
func NewAutoFuzzySearcher ¶
func NewConjunctionSearcher ¶
func NewDisjunctionSearcher ¶
func NewFuzzySearcher ¶
func NewGeoShapeSearcher ¶
func NewIPRangeSearcher ¶
func NewMultiTermSearcher ¶
func NewMultiTermSearcherBoosted ¶
func NewMultiTermSearcherBoosted(ctx context.Context, indexReader index.IndexReader, terms []string, field string, boost float64, editDistances []uint8, options search.SearcherOptions, limit bool) ( search.Searcher, error)
Works similarly to the multi term searcher but additionally boosts individual terms based on their edit distance from the query terms
func NewNumericRangeSearcher ¶
func NewRegexpSearcher ¶
func NewRegexpSearcher(ctx context.Context, indexReader index.IndexReader, pattern Regexp, field string, boost float64, options search.SearcherOptions) ( search.Searcher, error)
NewRegexpSearcher creates a searcher which will match documents that contain terms which match the pattern regexp. The match must be EXACT matching the entire term. The provided regexp SHOULD NOT start with ^ or end with $ as this can interfere with the implementation. Separately, matches will be checked to ensure they match the entire term.
func NewRegexpStringSearcher ¶
func NewRegexpStringSearcher(ctx context.Context, indexReader index.IndexReader, pattern string, field string, boost float64, options search.SearcherOptions) ( search.Searcher, error)
NewRegexpStringSearcher is similar to NewRegexpSearcher, but additionally optimizes for index readers that handle regexp's.
func NewSynonymSearcher ¶
func NewTermPrefixSearcher ¶
func NewTermRangeSearcher ¶
func NewTermSearcher ¶
func NewTermSearcherBytes ¶
Types ¶
type BooleanSearcher ¶
type BooleanSearcher struct {
// contains filtered or unexported fields
}
func NewBooleanSearcher ¶
func NewBooleanSearcher(ctx context.Context, indexReader index.IndexReader, mustSearcher search.Searcher, shouldSearcher search.Searcher, mustNotSearcher search.Searcher, options search.SearcherOptions) (*BooleanSearcher, error)
func (*BooleanSearcher) Advance ¶
func (s *BooleanSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*BooleanSearcher) Close ¶
func (s *BooleanSearcher) Close() error
func (*BooleanSearcher) Count ¶
func (s *BooleanSearcher) Count() uint64
func (*BooleanSearcher) DocumentMatchPoolSize ¶
func (s *BooleanSearcher) DocumentMatchPoolSize() int
func (*BooleanSearcher) Min ¶
func (s *BooleanSearcher) Min() int
func (*BooleanSearcher) Next ¶
func (s *BooleanSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*BooleanSearcher) SetQueryNorm ¶
func (s *BooleanSearcher) SetQueryNorm(qnorm float64)
func (*BooleanSearcher) Size ¶
func (s *BooleanSearcher) Size() int
func (*BooleanSearcher) Weight ¶
func (s *BooleanSearcher) Weight() float64
type CoalesceQueue ¶
type CoalesceQueue struct {
// contains filtered or unexported fields
}
------------------------------------------------------------------------------------------
func NewCoalesceQueue ¶
func NewCoalesceQueue() *CoalesceQueue
func (*CoalesceQueue) Dequeue ¶
func (cq *CoalesceQueue) Dequeue(ctx *search.SearchContext) *search.DocumentMatch
Dequeue removes and returns the next DocumentMatch in sorted order, merging any consecutive duplicates. Merged items are recycled via ctx.DocumentMatchPool. Returns nil when the queue is empty.
func (*CoalesceQueue) Enqueue ¶
func (cq *CoalesceQueue) Enqueue(it *search.DocumentMatch)
Enqueue appends the given DocumentMatch to the queue. Coalescing of duplicates is deferred until Dequeue, after Finalize has sorted items by IndexInternalID.
func (*CoalesceQueue) Finalize ¶
func (cq *CoalesceQueue) Finalize()
Finalize prepares the queue for dequeue operations by sorting the items based on their IndexInternalID values. This MUST be called before any Dequeue operations, and after all Enqueue operations are complete. The sort is done in descending order so that dequeueing will basically be popping from the end of the slice, allowing for slice reuse.
func (*CoalesceQueue) Len ¶
func (cq *CoalesceQueue) Len() int
Len returns the number of DocumentMatch items currently in the queue.
type ConjunctionSearcher ¶
type ConjunctionSearcher struct {
// contains filtered or unexported fields
}
func (*ConjunctionSearcher) Advance ¶
func (s *ConjunctionSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*ConjunctionSearcher) Close ¶
func (s *ConjunctionSearcher) Close() (rv error)
func (*ConjunctionSearcher) Count ¶
func (s *ConjunctionSearcher) Count() uint64
func (*ConjunctionSearcher) DocumentMatchPoolSize ¶
func (s *ConjunctionSearcher) DocumentMatchPoolSize() int
func (*ConjunctionSearcher) Min ¶
func (s *ConjunctionSearcher) Min() int
func (*ConjunctionSearcher) Next ¶
func (s *ConjunctionSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*ConjunctionSearcher) SetQueryNorm ¶
func (s *ConjunctionSearcher) SetQueryNorm(qnorm float64)
func (*ConjunctionSearcher) Size ¶
func (s *ConjunctionSearcher) Size() int
func (*ConjunctionSearcher) Weight ¶
func (s *ConjunctionSearcher) Weight() float64
type CustomFilterFunc ¶
type CustomFilterFunc func(d *search.DocumentMatch) bool
CustomFilterFunc decides whether a hit (with doc-value fields populated) should be kept. Unlike FilterFunc it does not receive a SearchContext since custom-query callbacks only need the DocumentMatch.
type CustomFilterSearcher ¶
type CustomFilterSearcher struct {
// contains filtered or unexported fields
}
CustomFilterSearcher wraps a child searcher, optionally loads doc values into each DocumentMatch, then applies a CustomFilterFunc to decide whether to keep the hit. Unlike FilteringSearcher this variant is purpose-built for custom queries that need field values at callback time.
func NewCustomFilterSearcher ¶
func NewCustomFilterSearcher(ctx context.Context, child search.Searcher, filter CustomFilterFunc, dvReader index.DocValueReader, indexReader index.IndexReader, fieldTypes map[string]string) *CustomFilterSearcher
func (*CustomFilterSearcher) Advance ¶
func (f *CustomFilterSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*CustomFilterSearcher) Close ¶
func (f *CustomFilterSearcher) Close() error
func (*CustomFilterSearcher) Count ¶
func (f *CustomFilterSearcher) Count() uint64
func (*CustomFilterSearcher) DocumentMatchPoolSize ¶
func (f *CustomFilterSearcher) DocumentMatchPoolSize() int
func (*CustomFilterSearcher) Min ¶
func (f *CustomFilterSearcher) Min() int
func (*CustomFilterSearcher) Next ¶
func (f *CustomFilterSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*CustomFilterSearcher) SetQueryNorm ¶
func (f *CustomFilterSearcher) SetQueryNorm(n float64)
func (*CustomFilterSearcher) Size ¶
func (f *CustomFilterSearcher) Size() int
func (*CustomFilterSearcher) Weight ¶
func (f *CustomFilterSearcher) Weight() float64
type CustomScoreFunc ¶
type CustomScoreFunc func(d *search.DocumentMatch) float64
CustomScoreFunc defines a function which can mutate document scores.
type CustomScoreSearcher ¶
type CustomScoreSearcher struct {
// contains filtered or unexported fields
}
CustomScoreSearcher wraps any other searcher, optionally loads doc values into each DocumentMatch, then mutates the score using the supplied CustomScoreFunc.
func NewCustomScoreSearcher ¶
func NewCustomScoreSearcher(ctx context.Context, s search.Searcher, mutate CustomScoreFunc, dvReader index.DocValueReader, indexReader index.IndexReader, fieldTypes map[string]string) *CustomScoreSearcher
func (*CustomScoreSearcher) Advance ¶
func (f *CustomScoreSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*CustomScoreSearcher) Close ¶
func (f *CustomScoreSearcher) Close() error
func (*CustomScoreSearcher) Count ¶
func (f *CustomScoreSearcher) Count() uint64
func (*CustomScoreSearcher) DocumentMatchPoolSize ¶
func (f *CustomScoreSearcher) DocumentMatchPoolSize() int
func (*CustomScoreSearcher) Min ¶
func (f *CustomScoreSearcher) Min() int
func (*CustomScoreSearcher) Next ¶
func (f *CustomScoreSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*CustomScoreSearcher) SetQueryNorm ¶
func (f *CustomScoreSearcher) SetQueryNorm(n float64)
func (*CustomScoreSearcher) Size ¶
func (f *CustomScoreSearcher) Size() int
func (*CustomScoreSearcher) Weight ¶
func (f *CustomScoreSearcher) Weight() float64
type DisjunctionHeapSearcher ¶
type DisjunctionHeapSearcher struct {
// contains filtered or unexported fields
}
func (*DisjunctionHeapSearcher) Advance ¶
func (s *DisjunctionHeapSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*DisjunctionHeapSearcher) Close ¶
func (s *DisjunctionHeapSearcher) Close() (rv error)
func (*DisjunctionHeapSearcher) Count ¶
func (s *DisjunctionHeapSearcher) Count() uint64
func (*DisjunctionHeapSearcher) DocumentMatchPoolSize ¶
func (s *DisjunctionHeapSearcher) DocumentMatchPoolSize() int
func (*DisjunctionHeapSearcher) Len ¶
func (s *DisjunctionHeapSearcher) Len() int
func (*DisjunctionHeapSearcher) Less ¶
func (s *DisjunctionHeapSearcher) Less(i, j int) bool
func (*DisjunctionHeapSearcher) Min ¶
func (s *DisjunctionHeapSearcher) Min() int
func (*DisjunctionHeapSearcher) Next ¶
func (s *DisjunctionHeapSearcher) Next(ctx *search.SearchContext) ( *search.DocumentMatch, error)
func (*DisjunctionHeapSearcher) Optimize ¶
func (s *DisjunctionHeapSearcher) Optimize(kind string, octx index.OptimizableContext) ( index.OptimizableContext, error)
a disjunction searcher implements the index.Optimizable interface but only activates on an edge case where the disjunction is a wrapper around a single Optimizable child searcher
func (*DisjunctionHeapSearcher) Pop ¶
func (s *DisjunctionHeapSearcher) Pop() interface{}
func (*DisjunctionHeapSearcher) Push ¶
func (s *DisjunctionHeapSearcher) Push(x interface{})
func (*DisjunctionHeapSearcher) SetQueryNorm ¶
func (s *DisjunctionHeapSearcher) SetQueryNorm(qnorm float64)
func (*DisjunctionHeapSearcher) Size ¶
func (s *DisjunctionHeapSearcher) Size() int
func (*DisjunctionHeapSearcher) Swap ¶
func (s *DisjunctionHeapSearcher) Swap(i, j int)
func (*DisjunctionHeapSearcher) Weight ¶
func (s *DisjunctionHeapSearcher) Weight() float64
type DisjunctionSliceSearcher ¶
type DisjunctionSliceSearcher struct {
// contains filtered or unexported fields
}
func (*DisjunctionSliceSearcher) Advance ¶
func (s *DisjunctionSliceSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID, ) (*search.DocumentMatch, error)
func (*DisjunctionSliceSearcher) Close ¶
func (s *DisjunctionSliceSearcher) Close() (rv error)
func (*DisjunctionSliceSearcher) Count ¶
func (s *DisjunctionSliceSearcher) Count() uint64
func (*DisjunctionSliceSearcher) DocumentMatchPoolSize ¶
func (s *DisjunctionSliceSearcher) DocumentMatchPoolSize() int
func (*DisjunctionSliceSearcher) Min ¶
func (s *DisjunctionSliceSearcher) Min() int
func (*DisjunctionSliceSearcher) Next ¶
func (s *DisjunctionSliceSearcher) Next(ctx *search.SearchContext) ( *search.DocumentMatch, error, )
func (*DisjunctionSliceSearcher) Optimize ¶
func (s *DisjunctionSliceSearcher) Optimize(kind string, octx index.OptimizableContext) ( index.OptimizableContext, error, )
a disjunction searcher implements the index.Optimizable interface but only activates on an edge case where the disjunction is a wrapper around a single Optimizable child searcher
func (*DisjunctionSliceSearcher) SetQueryNorm ¶
func (s *DisjunctionSliceSearcher) SetQueryNorm(qnorm float64)
func (*DisjunctionSliceSearcher) Size ¶
func (s *DisjunctionSliceSearcher) Size() int
func (*DisjunctionSliceSearcher) Weight ¶
func (s *DisjunctionSliceSearcher) Weight() float64
type DocIDSearcher ¶
type DocIDSearcher struct {
// contains filtered or unexported fields
}
DocIDSearcher returns documents matching a predefined set of identifiers.
func NewDocIDSearcher ¶
func NewDocIDSearcher(ctx context.Context, indexReader index.IndexReader, ids []string, boost float64, options search.SearcherOptions) (searcher *DocIDSearcher, err error)
func (*DocIDSearcher) Advance ¶
func (s *DocIDSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*DocIDSearcher) Close ¶
func (s *DocIDSearcher) Close() error
func (*DocIDSearcher) Count ¶
func (s *DocIDSearcher) Count() uint64
func (*DocIDSearcher) DocumentMatchPoolSize ¶
func (s *DocIDSearcher) DocumentMatchPoolSize() int
func (*DocIDSearcher) Min ¶
func (s *DocIDSearcher) Min() int
func (*DocIDSearcher) Next ¶
func (s *DocIDSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*DocIDSearcher) SetQueryNorm ¶
func (s *DocIDSearcher) SetQueryNorm(qnorm float64)
func (*DocIDSearcher) Size ¶
func (s *DocIDSearcher) Size() int
func (*DocIDSearcher) Weight ¶
func (s *DocIDSearcher) Weight() float64
type FilterFunc ¶
type FilterFunc func(sctx *search.SearchContext, d *search.DocumentMatch) bool
FilterFunc defines a function which can filter documents returning true means keep the document returning false means do not keep the document
type FilteringSearcher ¶
type FilteringSearcher struct {
// contains filtered or unexported fields
}
FilteringSearcher wraps any other searcher, but checks any Next/Advance call against the supplied FilterFunc
func NewFilteringSearcher ¶
func NewFilteringSearcher(ctx context.Context, s search.Searcher, filter FilterFunc) *FilteringSearcher
func (*FilteringSearcher) Advance ¶
func (f *FilteringSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*FilteringSearcher) Close ¶
func (f *FilteringSearcher) Close() error
func (*FilteringSearcher) Count ¶
func (f *FilteringSearcher) Count() uint64
func (*FilteringSearcher) DocumentMatchPoolSize ¶
func (f *FilteringSearcher) DocumentMatchPoolSize() int
func (*FilteringSearcher) Min ¶
func (f *FilteringSearcher) Min() int
func (*FilteringSearcher) Next ¶
func (f *FilteringSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*FilteringSearcher) SetQueryNorm ¶
func (f *FilteringSearcher) SetQueryNorm(n float64)
func (*FilteringSearcher) Size ¶
func (f *FilteringSearcher) Size() int
func (*FilteringSearcher) Weight ¶
func (f *FilteringSearcher) Weight() float64
type MatchAllSearcher ¶
type MatchAllSearcher struct {
// contains filtered or unexported fields
}
func NewMatchAllSearcher ¶
func NewMatchAllSearcher(ctx context.Context, indexReader index.IndexReader, boost float64, options search.SearcherOptions) (*MatchAllSearcher, error)
func (*MatchAllSearcher) Advance ¶
func (s *MatchAllSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*MatchAllSearcher) Close ¶
func (s *MatchAllSearcher) Close() error
func (*MatchAllSearcher) Count ¶
func (s *MatchAllSearcher) Count() uint64
func (*MatchAllSearcher) DocumentMatchPoolSize ¶
func (s *MatchAllSearcher) DocumentMatchPoolSize() int
func (*MatchAllSearcher) Min ¶
func (s *MatchAllSearcher) Min() int
func (*MatchAllSearcher) Next ¶
func (s *MatchAllSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*MatchAllSearcher) SetQueryNorm ¶
func (s *MatchAllSearcher) SetQueryNorm(qnorm float64)
func (*MatchAllSearcher) Size ¶
func (s *MatchAllSearcher) Size() int
func (*MatchAllSearcher) Weight ¶
func (s *MatchAllSearcher) Weight() float64
type MatchNoneSearcher ¶
type MatchNoneSearcher struct {
// contains filtered or unexported fields
}
func NewMatchNoneSearcher ¶
func NewMatchNoneSearcher(indexReader index.IndexReader) (*MatchNoneSearcher, error)
func (*MatchNoneSearcher) Advance ¶
func (s *MatchNoneSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*MatchNoneSearcher) Close ¶
func (s *MatchNoneSearcher) Close() error
func (*MatchNoneSearcher) Count ¶
func (s *MatchNoneSearcher) Count() uint64
func (*MatchNoneSearcher) DocumentMatchPoolSize ¶
func (s *MatchNoneSearcher) DocumentMatchPoolSize() int
func (*MatchNoneSearcher) Min ¶
func (s *MatchNoneSearcher) Min() int
func (*MatchNoneSearcher) Next ¶
func (s *MatchNoneSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*MatchNoneSearcher) SetQueryNorm ¶
func (s *MatchNoneSearcher) SetQueryNorm(qnorm float64)
func (*MatchNoneSearcher) Size ¶
func (s *MatchNoneSearcher) Size() int
func (*MatchNoneSearcher) Weight ¶
func (s *MatchNoneSearcher) Weight() float64
type NestedConjunctionSearcher ¶
type NestedConjunctionSearcher struct {
// contains filtered or unexported fields
}
func (*NestedConjunctionSearcher) Advance ¶
func (s *NestedConjunctionSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*NestedConjunctionSearcher) Close ¶
func (s *NestedConjunctionSearcher) Close() (rv error)
func (*NestedConjunctionSearcher) Count ¶
func (s *NestedConjunctionSearcher) Count() uint64
func (*NestedConjunctionSearcher) DocumentMatchPoolSize ¶
func (s *NestedConjunctionSearcher) DocumentMatchPoolSize() int
func (*NestedConjunctionSearcher) Min ¶
func (s *NestedConjunctionSearcher) Min() int
func (*NestedConjunctionSearcher) Next ¶
func (s *NestedConjunctionSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*NestedConjunctionSearcher) SetQueryNorm ¶
func (s *NestedConjunctionSearcher) SetQueryNorm(qnorm float64)
func (*NestedConjunctionSearcher) Size ¶
func (s *NestedConjunctionSearcher) Size() int
func (*NestedConjunctionSearcher) Weight ¶
func (s *NestedConjunctionSearcher) Weight() float64
type OrderedPositionalSearcherList ¶
type OrderedPositionalSearcherList struct {
// contains filtered or unexported fields
}
func (OrderedPositionalSearcherList) Len ¶
func (otrl OrderedPositionalSearcherList) Len() int
func (OrderedPositionalSearcherList) Less ¶
func (otrl OrderedPositionalSearcherList) Less(i, j int) bool
func (OrderedPositionalSearcherList) Swap ¶
func (otrl OrderedPositionalSearcherList) Swap(i, j int)
type OrderedSearcherList ¶
func (OrderedSearcherList) Len ¶
func (otrl OrderedSearcherList) Len() int
func (OrderedSearcherList) Less ¶
func (otrl OrderedSearcherList) Less(i, j int) bool
func (OrderedSearcherList) Swap ¶
func (otrl OrderedSearcherList) Swap(i, j int)
type PhraseSearcher ¶
type PhraseSearcher struct {
// contains filtered or unexported fields
}
func NewMultiPhraseSearcher ¶
func NewMultiPhraseSearcher(ctx context.Context, indexReader index.IndexReader, terms [][]string, fuzziness int, autoFuzzy bool, field string, boost float64, options search.SearcherOptions) (*PhraseSearcher, error)
func NewPhraseSearcher ¶
func NewPhraseSearcher(ctx context.Context, indexReader index.IndexReader, terms []string, fuzziness int, autoFuzzy bool, field string, boost float64, options search.SearcherOptions) (*PhraseSearcher, error)
func (*PhraseSearcher) Advance ¶
func (s *PhraseSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*PhraseSearcher) Close ¶
func (s *PhraseSearcher) Close() error
func (*PhraseSearcher) Count ¶
func (s *PhraseSearcher) Count() uint64
func (*PhraseSearcher) DocumentMatchPoolSize ¶
func (s *PhraseSearcher) DocumentMatchPoolSize() int
func (*PhraseSearcher) Min ¶
func (s *PhraseSearcher) Min() int
func (*PhraseSearcher) Next ¶
func (s *PhraseSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*PhraseSearcher) SetQueryNorm ¶
func (s *PhraseSearcher) SetQueryNorm(qnorm float64)
func (*PhraseSearcher) Size ¶
func (s *PhraseSearcher) Size() int
func (*PhraseSearcher) Weight ¶
func (s *PhraseSearcher) Weight() float64
type Regexp ¶
type Regexp interface {
FindStringIndex(s string) (loc []int)
LiteralPrefix() (prefix string, complete bool)
String() string
}
The Regexp interface defines the subset of the regexp.Regexp API methods that are used by bleve indexes, allowing callers to pass in alternate implementations.
type SearcherCurr ¶
type SearcherCurr struct {
// contains filtered or unexported fields
}
type TermSearcher ¶
type TermSearcher struct {
// contains filtered or unexported fields
}
func (*TermSearcher) Advance ¶
func (s *TermSearcher) Advance(ctx *search.SearchContext, ID index.IndexInternalID) (*search.DocumentMatch, error)
func (*TermSearcher) Close ¶
func (s *TermSearcher) Close() error
func (*TermSearcher) Count ¶
func (s *TermSearcher) Count() uint64
func (*TermSearcher) DocumentMatchPoolSize ¶
func (s *TermSearcher) DocumentMatchPoolSize() int
func (*TermSearcher) Min ¶
func (s *TermSearcher) Min() int
func (*TermSearcher) Next ¶
func (s *TermSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch, error)
func (*TermSearcher) Optimize ¶
func (s *TermSearcher) Optimize(kind string, octx index.OptimizableContext) ( index.OptimizableContext, error)
func (*TermSearcher) SetQueryNorm ¶
func (s *TermSearcher) SetQueryNorm(qnorm float64)
func (*TermSearcher) Size ¶
func (s *TermSearcher) Size() int
func (*TermSearcher) Weight ¶
func (s *TermSearcher) Weight() float64
Source Files
¶
- optimize_no_knn.go
- ordered_searchers_list.go
- search_boolean.go
- search_conjunction.go
- search_conjunction_nested.go
- search_custom_fields.go
- search_custom_filter.go
- search_custom_score.go
- search_disjunction.go
- search_disjunction_heap.go
- search_disjunction_slice.go
- search_docid.go
- search_filter.go
- search_fuzzy.go
- search_geoboundingbox.go
- search_geopointdistance.go
- search_geopolygon.go
- search_geoshape.go
- search_ip_range.go
- search_match_all.go
- search_match_none.go
- search_multi_term.go
- search_numeric_range.go
- search_phrase.go
- search_regexp.go
- search_term.go
- search_term_prefix.go
- search_term_range.go