search

package
v0.0.0-...-40a8154 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2014 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 DateRangeFacet struct {
	Name  string  `json:"name"`
	Start *string `json:"start,omitempty"`
	End   *string `json:"end,omitempty"`
	Count int     `json:"count"`
}

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

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         []*TermFacet         `json:"terms,omitempty"`
	NumericRanges []*NumericRangeFacet `json:"numeric_ranges,omitempty"`
	DateRanges    []*DateRangeFacet    `json:"date_ranges,omitempty"`
}

type FacetResults

type FacetResults map[string]FacetResult

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 FieldFragmentMap map[string][]string

type FieldTermLocationMap

type FieldTermLocationMap map[string]TermLocationMap

func MergeLocations

func MergeLocations(locations []FieldTermLocationMap) FieldTermLocationMap

type Location

type Location struct {
	Pos   float64 `json:"pos"`
	Start float64 `json:"start"`
	End   float64 `json:"end"`
}

type Locations

type Locations []*Location

type NumericRangeFacet

type NumericRangeFacet struct {
	Name  string   `json:"name"`
	Min   *float64 `json:"min,omitempty"`
	Max   *float64 `json:"max,omitempty"`
	Count int      `json:"count"`
}

type Searcher

type Searcher interface {
	Next() (*DocumentMatch, error)
	Advance(ID string) (*DocumentMatch, error)
	Close()
	Weight() float64
	SetQueryNorm(float64)
	Count() uint64
	Min() int
}

type TermFacet

type TermFacet struct {
	Term  string `json:"term"`
	Count int    `json:"count"`
}

type TermLocationMap

type TermLocationMap map[string]Locations

func MergeTermLocationMaps

func MergeTermLocationMaps(rv, other TermLocationMap) TermLocationMap

func (TermLocationMap) AddLocation

func (t TermLocationMap) AddLocation(term string, location *Location)

Jump to

Keyboard shortcuts

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