search

package
v1.0.0-beta.122 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FacetResponse

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

FacetResponse is a builder utility to convert facets from search backend to tigris response.

func NewFacetResponse

func NewFacetResponse(query search.Facets) *FacetResponse

func (*FacetResponse) Build

func (fb *FacetResponse) Build(r *[]tsApi.FacetCounts) map[string]*api.SearchFacet

Build converts search backend response to api.SearchFacet.

type Group

type Group struct {
	Hits []*Hit
	Keys []string
}

func NewGroup

func NewGroup(keys []string, hits []*Hit) *Group

type Groups

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

func NewGroups

func NewGroups() *Groups

func (*Groups) HasMoreGroups

func (g *Groups) HasMoreGroups() bool

func (*Groups) Len

func (g *Groups) Len() int

func (*Groups) Next

func (g *Groups) Next() (*Group, error)

type Hit

type Hit struct {
	Document map[string]any
	Match    *api.Match
}

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 Response

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

func (*Response) HasMore

func (r *Response) HasMore() bool

func (*Response) Next

func (r *Response) Next() (*ResultRow, error)

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) GetGroupedHitsIterator

func (*ResponseFactory) GetGroupedHitsIterator(response []tsApi.SearchResult) *Groups

func (*ResponseFactory) GetHitsIterator

func (*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.

func (*ResponseFactory) GetResponse

func (r *ResponseFactory) GetResponse(response []tsApi.SearchResult) Response

type ResultRow

type ResultRow struct {
	Hit   *Hit
	Group *Group
}

Jump to

Keyboard shortcuts

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