search

package
v1.0.0-beta.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	This  = 1
	That  = -1
	Equal = 0
)

Comparison outputs.

Variables

This section is empty.

Functions

This section is empty.

Types

type FacetAttrs

type FacetAttrs struct {
	// contains filtered or unexported fields
}

type FacetCount

type FacetCount struct {
	Value string
	Count int64
}

type Hit

type Hit struct {
	Document       map[string]interface{}
	TextMatchScore int64
}

func NewSearchHit

func NewSearchHit(tsHit *tsApi.SearchResultHit) *Hit

type Hits

type Hits struct {
	// contains filtered or unexported fields
}

func NewHits

func NewHits() *Hits

func (*Hits) HasMoreHits

func (h *Hits) HasMoreHits() bool

func (*Hits) Len

func (h *Hits) Len() int

func (*Hits) Next

func (h *Hits) Next() (*Hit, error)

type IHits

type IHits interface {
	Next() (*Hit, error)
	Len() int
	HasMoreHits() bool
}

type IHitsMutable

type IHitsMutable interface {
	IHits
	// contains filtered or unexported methods
}

type ResponseFactory

type ResponseFactory struct {
	// contains filtered or unexported fields
}

ResponseFactory is used to convert raw hits response to our Iterable that has final order of hits.

func NewResponseFactory

func NewResponseFactory(inputQuery *search.Query) *ResponseFactory

func (*ResponseFactory) GetHitsIterator

func (r *ResponseFactory) GetHitsIterator(response []tsApi.SearchResult) IHits

GetHitsIterator returns an IHits interface which contains hits results in an order that we need to stream out to the user.

type SortedFacets

type SortedFacets struct {
	// contains filtered or unexported fields
}

SortedFacets is a Temporary workaround to merge facet values when aggregating results from multi-search queries resulting from OR filters this is not very efficient as of now.

func NewSortedFacets

func NewSortedFacets() *SortedFacets

func (*SortedFacets) Add

func (f *SortedFacets) Add(tsCounts *tsApi.FacetCounts) error

Add creates or merges the facet counts with existing for each field new values cannot be added to this data structure once it has been sorted.

func (*SortedFacets) GetFacetCount

func (f *SortedFacets) GetFacetCount(field string) (*FacetCount, bool)

GetFacetCount removes from priority queue and returns the value with highest count for the field if present else returns nil, False.

func (*SortedFacets) GetStats

func (f *SortedFacets) GetStats(field string) *api.FacetStats

GetStats returns the computed stats for the faceted field.

type SortedMergeHits

type SortedMergeHits struct {
	// contains filtered or unexported fields
}

SortedMergeHits is a Priority queue to merge sorted results. This is used when we have multiple responses and we know that each response hits is already sorted.

func NewSortedHits

func NewSortedHits(sortingOrder *sort.Ordering) *SortedMergeHits

NewSortedHits returns hits in decreasing order by priority.

func (*SortedMergeHits) HasMoreHits

func (s *SortedMergeHits) HasMoreHits() bool

func (*SortedMergeHits) Len

func (s *SortedMergeHits) Len() int

func (*SortedMergeHits) Next

func (s *SortedMergeHits) Next() (*Hit, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL