bleve: Index | Files

package collector

import ""


Package Files

heap.go list.go slice.go topn.go


const CheckDoneEvery = uint64(1024)

CheckDoneEvery controls how frequently we check the context deadline


var PreAllocSizeSkipCap = 1000

PreAllocSizeSkipCap will cap preallocation to this amount when size+skip exceeds this value

func MakeTopNDocumentMatchHandler Uses

func MakeTopNDocumentMatchHandler(
    ctx *search.SearchContext) (search.DocumentMatchHandler, bool, error)

type TopNCollector Uses

type TopNCollector struct {
    // contains filtered or unexported fields

TopNCollector collects the top N hits, optionally skipping some results

func NewTopNCollector Uses

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 (*TopNCollector) Collect Uses

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 Uses

func (hc *TopNCollector) FacetResults() search.FacetResults

FacetResults returns the computed facets results

func (*TopNCollector) MaxScore Uses

func (hc *TopNCollector) MaxScore() float64

MaxScore returns the maximum score seen across all the hits

func (*TopNCollector) Results Uses

func (hc *TopNCollector) Results() search.DocumentMatchCollection

Results returns the collected hits

func (*TopNCollector) SetFacetsBuilder Uses

func (hc *TopNCollector) SetFacetsBuilder(facetsBuilder *search.FacetsBuilder)

SetFacetsBuilder registers a facet builder for this collector

func (*TopNCollector) Size Uses

func (hc *TopNCollector) Size() int

func (*TopNCollector) Took Uses

func (hc *TopNCollector) Took() time.Duration

Took returns the time spent collecting hits

func (*TopNCollector) Total Uses

func (hc *TopNCollector) Total() uint64

Total returns the total number of hits

Package collector imports 8 packages (graph) and is imported by 21 packages. Updated 2019-03-20. Refresh now. Tools for package owners.