Versions in this module Expand all Collapse all v1 v1.0.1 Jun 28, 2023 Changes in this version + const AbortM + const AddM + const DoneM + const GenericCost + const Geo + const Numeric + const QueryTypeKey + const SearchIOStatsCallbackKey + const SearchIncrementalCostKey + const Term + var HighTerm = strings.Repeat(string(utf8.MaxRune), 3) + var LowTerm = string([]byte{ ... }) + var MakeDocumentMatchHandlerKey = MakeDocumentMatchHandlerKeyType("MakeDocumentMatchHandlerKey") + func LevenshteinDistance(a, b string) int + func LevenshteinDistanceMax(a, b string, max int) (int, bool) + func LevenshteinDistanceMaxReuseSlice(a, b string, max int, d []int) (int, bool, []int) + func RecordSearchCost(ctx context.Context, msg SearchIncrementalCostCallbackMsg, bytes uint64) + type ArrayPositions []uint64 + func (ap ArrayPositions) Compare(other ArrayPositions) int + func (ap ArrayPositions) Equals(other ArrayPositions) bool + type BytesSlice [][]byte + func (p BytesSlice) Len() int + func (p BytesSlice) Less(i, j int) bool + func (p BytesSlice) Swap(i, j int) + type Collector interface + Collect func(ctx context.Context, searcher Searcher, reader index.IndexReader) error + FacetResults func() FacetResults + MaxScore func() float64 + Results func() DocumentMatchCollection + SetFacetsBuilder func(facetsBuilder *FacetsBuilder) + Took func() time.Duration + Total func() uint64 + type DateRangeFacet struct + Count int + End *string + Name string + Start *string + func (drf *DateRangeFacet) Same(other *DateRangeFacet) bool + type DateRangeFacets []*DateRangeFacet + func (drf DateRangeFacets) Add(dateRangeFacet *DateRangeFacet) DateRangeFacets + func (drf DateRangeFacets) Len() int + func (drf DateRangeFacets) Less(i, j int) bool + func (drf DateRangeFacets) Swap(i, j int) + type DocumentMatch struct + Expl *Explanation + FieldTermLocations []FieldTermLocation + Fields map[string]interface{} + Fragments FieldFragmentMap + HitNumber uint64 + ID string + Index string + IndexInternalID index.IndexInternalID + Locations FieldTermLocationMap + Score float64 + Sort []string + func (dm *DocumentMatch) AddFieldValue(name string, value interface{}) + func (dm *DocumentMatch) Complete(prealloc []Location) []Location + func (dm *DocumentMatch) Reset() *DocumentMatch + func (dm *DocumentMatch) Size() int + func (dm *DocumentMatch) String() string + type DocumentMatchCollection []*DocumentMatch + func (c DocumentMatchCollection) Len() int + func (c DocumentMatchCollection) Less(i, j int) bool + func (c DocumentMatchCollection) Swap(i, j int) + type DocumentMatchHandler func(hit *DocumentMatch) error + type DocumentMatchPool struct + TooSmall DocumentMatchPoolTooSmall + func NewDocumentMatchPool(size, sortsize int) *DocumentMatchPool + func (p *DocumentMatchPool) Get() *DocumentMatch + func (p *DocumentMatchPool) Put(d *DocumentMatch) + type DocumentMatchPoolTooSmall func(p *DocumentMatchPool) *DocumentMatch + type Explanation struct + Children []*Explanation + Message string + Value float64 + func (expl *Explanation) Size() int + func (expl *Explanation) String() string + type FacetBuilder interface + EndDoc func() + Field func() string + Result func() *FacetResult + Size func() int + StartDoc func() + UpdateVisitor func(term []byte) + type FacetResult struct + DateRanges DateRangeFacets + Field string + Missing int + NumericRanges NumericRangeFacets + Other int + Terms *TermFacets + Total int + func (fr *FacetResult) Fixup(size int) + func (fr *FacetResult) Merge(other *FacetResult) + func (fr *FacetResult) Size() int + type FacetResults map[string]*FacetResult + func (fr FacetResults) Fixup(name string, size int) + func (fr FacetResults) Merge(other FacetResults) + type FacetsBuilder struct + func NewFacetsBuilder(indexReader index.IndexReader) *FacetsBuilder + func (fb *FacetsBuilder) Add(name string, facetBuilder FacetBuilder) + func (fb *FacetsBuilder) EndDoc() + func (fb *FacetsBuilder) RequiredFields() []string + func (fb *FacetsBuilder) Results() FacetResults + func (fb *FacetsBuilder) Size() int + func (fb *FacetsBuilder) StartDoc() + func (fb *FacetsBuilder) UpdateVisitor(field string, term []byte) + type FieldFragmentMap map[string][]string + type FieldTermLocation struct + Field string + Location Location + Term string + func MergeFieldTermLocations(dest []FieldTermLocation, matches []*DocumentMatch) []FieldTermLocation + type FieldTermLocationMap map[string]TermLocationMap + func MergeLocations(locations []FieldTermLocationMap) FieldTermLocationMap + type Location struct + ArrayPositions ArrayPositions + End uint64 + Pos uint64 + Start uint64 + func (l *Location) Size() int + type Locations []*Location + func (p Locations) Dedupe() Locations + func (p Locations) Len() int + func (p Locations) Less(i, j int) bool + func (p Locations) Swap(i, j int) + type MakeDocumentMatchHandler func(ctx *SearchContext) (callback DocumentMatchHandler, loadID bool, err error) + type MakeDocumentMatchHandlerKeyType string + type NumericRangeFacet struct + Count int + Max *float64 + Min *float64 + Name string + func (nrf *NumericRangeFacet) Same(other *NumericRangeFacet) bool + type NumericRangeFacets []*NumericRangeFacet + func (nrf NumericRangeFacets) Add(numericRangeFacet *NumericRangeFacet) NumericRangeFacets + func (nrf NumericRangeFacets) Len() int + func (nrf NumericRangeFacets) Less(i, j int) bool + func (nrf NumericRangeFacets) Swap(i, j int) + type SearchContext struct + Collector Collector + DocumentMatchPool *DocumentMatchPool + IndexReader index.IndexReader + func (sc *SearchContext) Size() int + type SearchIOStatsCallbackFunc func(uint64) + type SearchIncrementalCostCallbackFn func(SearchIncrementalCostCallbackMsg, SearchQueryType, uint64) + type SearchIncrementalCostCallbackMsg uint + type SearchQueryType uint + type SearchSort interface + Copy func() SearchSort + Descending func() bool + RequiresDocID func() bool + RequiresFields func() []string + RequiresScoring func() bool + Reverse func() + UpdateVisitor func(field string, term []byte) + Value func(a *DocumentMatch) string + func ParseSearchSortJSON(input json.RawMessage) (SearchSort, error) + func ParseSearchSortObj(input map[string]interface{}) (SearchSort, error) + func ParseSearchSortString(input string) SearchSort + type Searcher interface + Advance func(ctx *SearchContext, ID index.IndexInternalID) (*DocumentMatch, error) + Close func() error + Count func() uint64 + DocumentMatchPoolSize func() int + Min func() int + Next func(ctx *SearchContext) (*DocumentMatch, error) + SetQueryNorm func(float64) + Size func() int + Weight func() float64 + type SearcherOptions struct + Explain bool + IncludeTermVectors bool + Score string + type SortDocID struct + Desc bool + func (s *SortDocID) Copy() SearchSort + func (s *SortDocID) Descending() bool + func (s *SortDocID) MarshalJSON() ([]byte, error) + func (s *SortDocID) RequiresDocID() bool + func (s *SortDocID) RequiresFields() []string + func (s *SortDocID) RequiresScoring() bool + func (s *SortDocID) Reverse() + func (s *SortDocID) UpdateVisitor(field string, term []byte) + func (s *SortDocID) Value(i *DocumentMatch) string + type SortField struct + Desc bool + Field string + Missing SortFieldMissing + Mode SortFieldMode + Type SortFieldType + func (s *SortField) Copy() SearchSort + func (s *SortField) Descending() bool + func (s *SortField) MarshalJSON() ([]byte, error) + func (s *SortField) RequiresDocID() bool + func (s *SortField) RequiresFields() []string + func (s *SortField) RequiresScoring() bool + func (s *SortField) Reverse() + func (s *SortField) UpdateVisitor(field string, term []byte) + func (s *SortField) Value(i *DocumentMatch) string + type SortFieldMissing int + const SortFieldMissingFirst + const SortFieldMissingLast + type SortFieldMode int + const SortFieldDefault + const SortFieldMax + const SortFieldMin + type SortFieldType int + const SortFieldAsDate + const SortFieldAsNumber + const SortFieldAsString + const SortFieldAuto + type SortGeoDistance struct + Desc bool + Field string + Lat float64 + Lon float64 + Unit string + func NewSortGeoDistance(field, unit string, lon, lat float64, desc bool) (*SortGeoDistance, error) + func (s *SortGeoDistance) Copy() SearchSort + func (s *SortGeoDistance) Descending() bool + func (s *SortGeoDistance) MarshalJSON() ([]byte, error) + func (s *SortGeoDistance) RequiresDocID() bool + func (s *SortGeoDistance) RequiresFields() []string + func (s *SortGeoDistance) RequiresScoring() bool + func (s *SortGeoDistance) Reverse() + func (s *SortGeoDistance) UpdateVisitor(field string, term []byte) + func (s *SortGeoDistance) Value(i *DocumentMatch) string + type SortOrder []SearchSort + func ParseSortOrderJSON(in []json.RawMessage) (SortOrder, error) + func ParseSortOrderStrings(in []string) SortOrder + func (so SortOrder) CacheDescending() []bool + func (so SortOrder) CacheIsScore() []bool + func (so SortOrder) Compare(cachedScoring, cachedDesc []bool, i, j *DocumentMatch) int + func (so SortOrder) Copy() SortOrder + func (so SortOrder) RequiredFields() []string + func (so SortOrder) RequiresDocID() bool + func (so SortOrder) RequiresScore() bool + func (so SortOrder) Reverse() + func (so SortOrder) UpdateVisitor(field string, term []byte) + func (so SortOrder) Value(doc *DocumentMatch) + type SortScore struct + Desc bool + func (s *SortScore) Copy() SearchSort + func (s *SortScore) Descending() bool + func (s *SortScore) MarshalJSON() ([]byte, error) + func (s *SortScore) RequiresDocID() bool + func (s *SortScore) RequiresFields() []string + func (s *SortScore) RequiresScoring() bool + func (s *SortScore) Reverse() + func (s *SortScore) UpdateVisitor(field string, term []byte) + func (s *SortScore) Value(i *DocumentMatch) string + type TermFacet struct + Count int + Term string + type TermFacets struct + func (tf *TermFacets) Add(termFacets ...*TermFacet) + func (tf *TermFacets) Len() int + func (tf *TermFacets) Less(i, j int) bool + func (tf *TermFacets) MarshalJSON() ([]byte, error) + func (tf *TermFacets) Swap(i, j int) + func (tf *TermFacets) Terms() []*TermFacet + func (tf *TermFacets) TrimToTopN(n int) + func (tf *TermFacets) UnmarshalJSON(b []byte) error + type TermLocationMap map[string]Locations + func MergeTermLocationMaps(rv, other TermLocationMap) TermLocationMap + func (t TermLocationMap) AddLocation(term string, location *Location)