search

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSearchPageType

func RegisterSearchPageType(pgtype string)

func SearchDocument

func SearchDocument(p *page.Page) (doc search.Document, err error)

func SearchMapping

func SearchMapping(p *page.Page) (doctype string, dm *mapping.DocumentMapping, err error)

Types

type ArrayPositions

type ArrayPositions []uint64

type DocumentMatch

type DocumentMatch struct {
	Index string `json:"index,omitempty"`
	ID    string `json:"id"`
	// IndexInternalID    index.IndexInternalID  `json:"-"`
	Score              float64                `json:"score"`
	Expl               *Explanation           `json:"explanation,omitempty"`
	Locations          FieldTermLocationMap   `json:"locations,omitempty"`
	Fragments          FieldFragmentMap       `json:"fragments,omitempty"`
	Sort               []string               `json:"sort,omitempty"`
	Fields             map[string]interface{} `json:"fields,omitempty"`
	HitNumber          uint64                 `json:"-"`
	FieldTermLocations []FieldTermLocation    `json:"-"`
}

type DocumentMatchCollection

type DocumentMatchCollection []*DocumentMatch

type Explanation

type Explanation struct {
	Value    float64        `json:"value"`
	Message  string         `json:"message"`
	Children []*Explanation `json:"children,omitempty"`
}

type FacetResult

type FacetResult struct {
	Field   string `json:"field"`
	Total   int    `json:"total"`
	Missing int    `json:"missing"`
	Other   int    `json:"other"`
}

type FacetResults

type FacetResults map[string]*FacetResult

type FieldFragmentMap

type FieldFragmentMap map[string][]string

type FieldTermLocation

type FieldTermLocation struct {
	Field    string
	Term     string
	Location Location
}

type FieldTermLocationMap

type FieldTermLocationMap map[string]TermLocationMap

type HighlightRequest

type HighlightRequest struct {
	Style  *string  `json:"style"`
	Fields []string `json:"fields"`
}

type IndexErrMap

type IndexErrMap map[string]error

type Location

type Location struct {
	Pos            uint64         `json:"pos"`
	Start          uint64         `json:"start"`
	End            uint64         `json:"end"`
	ArrayPositions ArrayPositions `json:"array_positions"`
}

type Locations

type Locations []*Location

type SearchRequest

type SearchRequest struct {
	// Query            query.Query       `json:"query"`
	Size      int               `json:"size"`
	From      int               `json:"from"`
	Highlight *HighlightRequest `json:"highlight"`
	Fields    []string          `json:"fields"`
	// Facets           FacetsRequest     `json:"facets"`
	Explain bool `json:"explain"`
	// Sort             search.SortOrder  `json:"sort"`
	IncludeLocations bool     `json:"includeLocations"`
	Score            string   `json:"score,omitempty"`
	SearchAfter      []string `json:"search_after"`
	SearchBefore     []string `json:"search_before"`
	// contains filtered or unexported fields
}

type SearchResult

type SearchResult struct {
	Status    *SearchStatus           `json:"status"`
	Request   *SearchRequest          `json:"request"`
	Hits      DocumentMatchCollection `json:"hits"`
	Total     uint64                  `json:"total_hits"`
	BytesRead uint64                  `json:"bytesRead,omitempty"`
	MaxScore  float64                 `json:"max_score"`
	Took      time.Duration           `json:"took"`
	Facets    FacetResults            `json:"facets"`
}

type SearchStatus

type SearchStatus struct {
	Total      int         `json:"total"`
	Failed     int         `json:"failed"`
	Successful int         `json:"successful"`
	Errors     IndexErrMap `json:"errors,omitempty"`
}

type TermLocationMap

type TermLocationMap map[string]Locations

Jump to

Keyboard shortcuts

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