Documentation ¶
Index ¶
- type Collector
- type DateRangeFacet
- type DateRangeFacets
- type DocumentMatch
- type DocumentMatchCollection
- type Explanation
- type FacetBuilder
- type FacetResult
- type FacetResults
- type FacetsBuilder
- type FieldFragmentMap
- type FieldTermLocationMap
- type Location
- type Locations
- type NumericRangeFacet
- type NumericRangeFacets
- type Searcher
- type TermFacet
- type TermFacets
- type TermLocationMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface { Collect(searcher Searcher) error Results() DocumentMatchCollection Total() uint64 MaxScore() float64 Took() time.Duration SetFacetsBuilder(facetsBuilder *FacetsBuilder) FacetResults() FacetResults }
type DateRangeFacet ¶
type DateRangeFacets ¶
type DateRangeFacets []*DateRangeFacet
func (DateRangeFacets) Add ¶
func (drf DateRangeFacets) Add(dateRangeFacet *DateRangeFacet) DateRangeFacets
func (DateRangeFacets) Len ¶
func (drf DateRangeFacets) Len() int
func (DateRangeFacets) Less ¶
func (drf DateRangeFacets) Less(i, j int) bool
func (DateRangeFacets) Swap ¶
func (drf DateRangeFacets) Swap(i, j int)
type DocumentMatch ¶
type DocumentMatch struct { ID string `json:"id"` Score float64 `json:"score"` Expl *Explanation `json:"explanation,omitempty"` Locations FieldTermLocationMap `json:"locations,omitempty"` Fragments FieldFragmentMap `json:"fragments,omitempty"` Fields map[string]interface{} `json:"fields,omitempty"` }
func (*DocumentMatch) AddFieldValue ¶
func (dm *DocumentMatch) AddFieldValue(name string, value interface{})
type DocumentMatchCollection ¶
type DocumentMatchCollection []*DocumentMatch
func (DocumentMatchCollection) Len ¶
func (c DocumentMatchCollection) Len() int
func (DocumentMatchCollection) Less ¶
func (c DocumentMatchCollection) Less(i, j int) bool
func (DocumentMatchCollection) Swap ¶
func (c DocumentMatchCollection) Swap(i, j int)
type Explanation ¶
type Explanation struct { Value float64 `json:"value"` Message string `json:"message"` Children []*Explanation `json:"children,omitempty"` }
func (*Explanation) String ¶
func (expl *Explanation) String() string
type FacetBuilder ¶
type FacetBuilder interface { Update(index.FieldTerms) Result() *FacetResult }
type FacetResult ¶
type FacetResult struct { Field string `json:"field"` Total int `json:"total"` Missing int `json:"missing"` Other int `json:"other"` Terms TermFacets `json:"terms,omitempty"` NumericRanges NumericRangeFacets `json:"numeric_ranges,omitempty"` DateRanges DateRangeFacets `json:"date_ranges,omitempty"` }
func (*FacetResult) Fixup ¶
func (fr *FacetResult) Fixup(size int)
func (*FacetResult) Merge ¶
func (fr *FacetResult) Merge(other *FacetResult)
type FacetResults ¶
type FacetResults map[string]*FacetResult
func (FacetResults) Fixup ¶
func (fr FacetResults) Fixup(name string, size int)
func (FacetResults) Merge ¶
func (fr FacetResults) Merge(other FacetResults)
type FacetsBuilder ¶
type FacetsBuilder struct {
// contains filtered or unexported fields
}
func NewFacetsBuilder ¶
func NewFacetsBuilder(indexReader index.IndexReader) *FacetsBuilder
func (*FacetsBuilder) Add ¶
func (fb *FacetsBuilder) Add(name string, facetBuilder FacetBuilder)
func (*FacetsBuilder) Results ¶
func (fb *FacetsBuilder) Results() FacetResults
func (*FacetsBuilder) Update ¶
func (fb *FacetsBuilder) Update(docMatch *DocumentMatch) error
type FieldFragmentMap ¶
type FieldTermLocationMap ¶
type FieldTermLocationMap map[string]TermLocationMap
func MergeLocations ¶
func MergeLocations(locations []FieldTermLocationMap) FieldTermLocationMap
type NumericRangeFacet ¶
type NumericRangeFacets ¶
type NumericRangeFacets []*NumericRangeFacet
func (NumericRangeFacets) Add ¶
func (nrf NumericRangeFacets) Add(numericRangeFacet *NumericRangeFacet) NumericRangeFacets
func (NumericRangeFacets) Len ¶
func (nrf NumericRangeFacets) Len() int
func (NumericRangeFacets) Less ¶
func (nrf NumericRangeFacets) Less(i, j int) bool
func (NumericRangeFacets) Swap ¶
func (nrf NumericRangeFacets) Swap(i, j int)
type Searcher ¶
type Searcher interface { Next() (*DocumentMatch, error) Advance(ID string) (*DocumentMatch, error) Close() Weight() float64 SetQueryNorm(float64) Count() uint64 Min() int }
type TermFacets ¶
type TermFacets []*TermFacet
func (TermFacets) Add ¶
func (tf TermFacets) Add(termFacet *TermFacet) TermFacets
func (TermFacets) Len ¶
func (tf TermFacets) Len() int
func (TermFacets) Less ¶
func (tf TermFacets) Less(i, j int) bool
func (TermFacets) Swap ¶
func (tf TermFacets) Swap(i, j int)
type TermLocationMap ¶
func MergeTermLocationMaps ¶
func MergeTermLocationMaps(rv, other TermLocationMap) TermLocationMap
func (TermLocationMap) AddLocation ¶
func (t TermLocationMap) AddLocation(term string, location *Location)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.