searchgrader

package
v0.0.0-...-0fffe9f Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

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.

type UpdateGradeOptions

type UpdateGradeOptions struct {
	DocID        string
	Script       string
	Record       map[string]interface{}
	ScriptParams map[string]interface{}
}

UpdateGradeOptions represents the options for updating grade

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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