Documentation
¶
Index ¶
- type ESDoc
- type ESRecord
- type GradeMetricsRequest
- type GradeMetricsResponse
- type GradeRequest
- type SearchGrader
- func (s *SearchGrader) AlternateRoutes() []plugins.Route
- func (s *SearchGrader) ESMiddleware() []middleware.Middleware
- func (s *SearchGrader) InitFunc() error
- func (s *SearchGrader) Name() string
- func (s *SearchGrader) RSMiddleware() []middleware.Middleware
- func (s *SearchGrader) Routes() []plugins.Route
- type UpdateGradeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ESDoc ¶
type ESDoc struct {
Index string `json:"index,omitempty"`
Query *string `json:"query,omitempty"`
DocID *string `json:"doc_id,omitempty"`
Grade *int `json:"grade,omitempty"`
}
ESDoc represents the ES document structure for search grader
type ESRecord ¶
type ESRecord struct {
Index string `json:"index,omitempty"`
Query *string `json:"query,omitempty"`
DocID *string `json:"doc_id,omitempty"`
Grade *int `json:"grade,omitempty"`
}
ESRecord represents the document to be updated to ES
type GradeMetricsRequest ¶
type GradeMetricsRequest struct {
Indices []string `json:"indices"`
Page *int `json:"page,omitempty"`
}
GradeMetricsRequest represents the request body struct for grade metrics endpoint
type GradeMetricsResponse ¶
type GradeMetricsResponse struct {
Total int `json:"total"`
Metrics map[string]map[string]int `json:"metrics"`
}
GradeMetricsResponse represents the response body struct for grade metrics endpoint
type GradeRequest ¶
type GradeRequest struct {
Query *string `json:"query,omitempty"`
Grade *int `json:"grade,omitempty"`
}
GradeRequest represents the request body for grade document API
type SearchGrader ¶
type SearchGrader struct {
// contains filtered or unexported fields
}
SearchGrader plugin exposes the routes to record and retrieve search grades.
func Instance ¶
func Instance() *SearchGrader
Instance returns the singleton instace of SearchGrader plugin. Note: Only this function must be used (both within and outside the package) to obtain the instance searchgrader in order to avoid stateless instances of the plugin.
func (*SearchGrader) AlternateRoutes ¶
func (s *SearchGrader) AlternateRoutes() []plugins.Route
Expose plugin specific routes
func (*SearchGrader) ESMiddleware ¶
func (s *SearchGrader) ESMiddleware() []middleware.Middleware
func (*SearchGrader) InitFunc ¶
func (s *SearchGrader) InitFunc() error
InitFunc is a part of Plugin interface that gets executed only once, and initializes the dao, i.e. elasticsearch before the plugin is operational.
func (*SearchGrader) Name ¶
func (s *SearchGrader) Name() string
Name is a part of Plugin interface that returns the name of the plugin: 'searchgrader'.
func (*SearchGrader) RSMiddleware ¶
func (s *SearchGrader) RSMiddleware() []middleware.Middleware
func (*SearchGrader) Routes ¶
func (s *SearchGrader) Routes() []plugins.Route
Routes returns the searchgrader routes that the plugin serves.