Documentation ¶
Index ¶
- Constants
- Variables
- func FilterHitsBySearchAfter(hits []*search.DocumentMatch, sort search.SortOrder, after []string) []*search.DocumentMatch
- func MakeTopNDocumentMatchHandler(ctx *search.SearchContext) (search.DocumentMatchHandler, bool, error)
- type EligibleCollector
- func (ec *EligibleCollector) Collect(ctx context.Context, searcher search.Searcher, reader index.IndexReader) error
- func (ec *EligibleCollector) FacetResults() search.FacetResults
- func (ec *EligibleCollector) IDs() []index.IndexInternalID
- func (ec *EligibleCollector) MaxScore() float64
- func (ec *EligibleCollector) Results() search.DocumentMatchCollection
- func (ec *EligibleCollector) SetFacetsBuilder(facetsBuilder *search.FacetsBuilder)
- func (ec *EligibleCollector) Took() time.Duration
- func (ec *EligibleCollector) Total() uint64
- type TopNCollector
- func (hc *TopNCollector) Collect(ctx context.Context, searcher search.Searcher, reader index.IndexReader) error
- func (hc *TopNCollector) FacetResults() search.FacetResults
- func (hc *TopNCollector) MaxScore() float64
- func (hc *TopNCollector) Results() search.DocumentMatchCollection
- func (hc *TopNCollector) SetFacetsBuilder(facetsBuilder *search.FacetsBuilder)
- func (hc *TopNCollector) SetKNNHits(knnHits search.DocumentMatchCollection, ...)
- func (hc *TopNCollector) Size() int
- func (hc *TopNCollector) Took() time.Duration
- func (hc *TopNCollector) Total() uint64
Constants ¶
const CheckDoneEvery = uint64(1024)
CheckDoneEvery controls how frequently we check the context deadline
Variables ¶
var PreAllocSizeSkipCap = 1000
PreAllocSizeSkipCap will cap preallocation to this amount when size+skip exceeds this value
Functions ¶
func FilterHitsBySearchAfter ¶ added in v2.4.0
func FilterHitsBySearchAfter(hits []*search.DocumentMatch, sort search.SortOrder, after []string) []*search.DocumentMatch
Filter document matches based on the SearchAfter field in the SearchRequest.
func MakeTopNDocumentMatchHandler ¶
func MakeTopNDocumentMatchHandler( ctx *search.SearchContext) (search.DocumentMatchHandler, bool, error)
Types ¶
type EligibleCollector ¶ added in v2.4.3
type EligibleCollector struct {
// contains filtered or unexported fields
}
func NewEligibleCollector ¶ added in v2.4.3
func NewEligibleCollector(size int) *EligibleCollector
func (*EligibleCollector) Collect ¶ added in v2.4.3
func (ec *EligibleCollector) Collect(ctx context.Context, searcher search.Searcher, reader index.IndexReader) error
func (*EligibleCollector) FacetResults ¶ added in v2.4.3
func (ec *EligibleCollector) FacetResults() search.FacetResults
func (*EligibleCollector) IDs ¶ added in v2.4.3
func (ec *EligibleCollector) IDs() []index.IndexInternalID
func (*EligibleCollector) MaxScore ¶ added in v2.4.3
func (ec *EligibleCollector) MaxScore() float64
No concept of scoring in the eligible collector.
func (*EligibleCollector) Results ¶ added in v2.4.3
func (ec *EligibleCollector) Results() search.DocumentMatchCollection
func (*EligibleCollector) SetFacetsBuilder ¶ added in v2.4.3
func (ec *EligibleCollector) SetFacetsBuilder(facetsBuilder *search.FacetsBuilder)
func (*EligibleCollector) Took ¶ added in v2.4.3
func (ec *EligibleCollector) Took() time.Duration
func (*EligibleCollector) Total ¶ added in v2.4.3
func (ec *EligibleCollector) Total() uint64
type TopNCollector ¶
type TopNCollector struct {
// contains filtered or unexported fields
}
TopNCollector collects the top N hits, optionally skipping some results
func NewTopNCollector ¶
func NewTopNCollector(size int, skip int, sort search.SortOrder) *TopNCollector
NewTopNCollector builds a collector to find the top 'size' hits skipping over the first 'skip' hits ordering hits by the provided sort order
func NewTopNCollectorAfter ¶
func NewTopNCollectorAfter(size int, sort search.SortOrder, after []string) *TopNCollector
NewTopNCollectorAfter builds a collector to find the top 'size' hits skipping over the first 'skip' hits ordering hits by the provided sort order
func (*TopNCollector) Collect ¶
func (hc *TopNCollector) Collect(ctx context.Context, searcher search.Searcher, reader index.IndexReader) error
Collect goes to the index to find the matching documents
func (*TopNCollector) FacetResults ¶
func (hc *TopNCollector) FacetResults() search.FacetResults
FacetResults returns the computed facets results
func (*TopNCollector) MaxScore ¶
func (hc *TopNCollector) MaxScore() float64
MaxScore returns the maximum score seen across all the hits
func (*TopNCollector) Results ¶
func (hc *TopNCollector) Results() search.DocumentMatchCollection
Results returns the collected hits
func (*TopNCollector) SetFacetsBuilder ¶
func (hc *TopNCollector) SetFacetsBuilder(facetsBuilder *search.FacetsBuilder)
SetFacetsBuilder registers a facet builder for this collector
func (*TopNCollector) SetKNNHits ¶ added in v2.4.0
func (hc *TopNCollector) SetKNNHits(knnHits search.DocumentMatchCollection, newScoreExplComputer search.ScoreExplCorrectionCallbackFunc)
func (*TopNCollector) Size ¶
func (hc *TopNCollector) Size() int
func (*TopNCollector) Took ¶
func (hc *TopNCollector) Took() time.Duration
Took returns the time spent collecting hits
func (*TopNCollector) Total ¶
func (hc *TopNCollector) Total() uint64
Total returns the total number of hits