searchV2

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocumentFieldCreatedAt = "created_at"
	DocumentFieldUpdatedAt = "updated_at"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DashboardIndexExtender

type DashboardIndexExtender interface {
	GetDocumentExtender() DocumentExtender
	GetQueryExtender(query DashboardQuery) QueryExtender
}

type DashboardQuery

type DashboardQuery struct {
	Query              string       `json:"query"`
	Location           string       `json:"location,omitempty"` // parent folder ID
	Sort               string       `json:"sort,omitempty"`     // field ASC/DESC
	Datasource         string       `json:"ds_uid,omitempty"`   // "datasource" collides with the JSON value at the same leel :()
	DatasourceType     string       `json:"ds_type,omitempty"`
	Tags               []string     `json:"tags,omitempty"`
	Kind               []string     `json:"kind,omitempty"`
	PanelType          string       `json:"panel_type,omitempty"`
	UIDs               []string     `json:"uid,omitempty"`
	Explain            bool         `json:"explain,omitempty"`            // adds details on why document matched
	WithAllowedActions bool         `json:"withAllowedActions,omitempty"` // adds allowed actions per entity
	Facet              []FacetField `json:"facet,omitempty"`
	SkipLocation       bool         `json:"skipLocation,omitempty"`
	HasPreview         string       `json:"hasPreview,omitempty"` // the light|dark theme
	Limit              int          `json:"limit,omitempty"`      // explicit page size
	From               int          `json:"from,omitempty"`       // for paging
}

type DocumentExtender

type DocumentExtender interface {
	GetDashboardExtender(orgID int64, uids ...string) ExtendDashboardFunc
}

type ExtendDashboardFunc

type ExtendDashboardFunc func(uid string, doc *bluge.Document) error

type FacetField

type FacetField struct {
	Field string `json:"field"`
	Limit int    `json:"limit,omitempty"` // explicit page size
}

type FramerFunc

type FramerFunc func(field string, value []byte)

type FutureAuthService

type FutureAuthService interface {
	GetDashboardReadFilter(ctx context.Context, orgID int64, user *user.SignedInUser) (ResourceFilter, error)
}

FutureAuthService eventually implemented by the security service

type IsSearchReadyResponse

type IsSearchReadyResponse struct {
	IsReady bool
	Reason  string // initial-indexing-ongoing, org-indexing-ongoing
}

type MockSearchService

type MockSearchService struct {
	mock.Mock
}

MockSearchService is an autogenerated mock type for the SearchService type

func (*MockSearchService) DoDashboardQuery

func (_m *MockSearchService) DoDashboardQuery(ctx context.Context, _a1 *backend.User, orgId int64, query DashboardQuery) *backend.DataResponse

DoDashboardQuery provides a mock function with given fields: ctx, _a1, orgId, query

func (*MockSearchService) IsDisabled

func (_m *MockSearchService) IsDisabled() bool

IsDisabled provides a mock function with given fields:

func (*MockSearchService) IsReady

IsReady provides a mock function with given fields: ctx, orgId

func (*MockSearchService) RegisterDashboardIndexExtender

func (_m *MockSearchService) RegisterDashboardIndexExtender(ext DashboardIndexExtender)

RegisterDashboardIndexExtender provides a mock function with given fields: ext

func (*MockSearchService) Run

func (_m *MockSearchService) Run(ctx context.Context) error

Run provides a mock function with given fields: ctx

func (*MockSearchService) TriggerReIndex

func (_m *MockSearchService) TriggerReIndex()

TriggerReIndex provides a mock function with given fields:

type NoopDocumentExtender

type NoopDocumentExtender struct{}

func (NoopDocumentExtender) GetDashboardExtender

func (n NoopDocumentExtender) GetDashboardExtender(_ int64, _ ...string) ExtendDashboardFunc

type NoopExtender

type NoopExtender struct{}

func (NoopExtender) GetDocumentExtender

func (n NoopExtender) GetDocumentExtender() DocumentExtender

func (NoopExtender) GetQueryExtender

func (n NoopExtender) GetQueryExtender(query DashboardQuery) QueryExtender

type NoopQueryExtender

type NoopQueryExtender struct{}

func (NoopQueryExtender) GetFramer

func (n NoopQueryExtender) GetFramer(_ *data.Frame) FramerFunc

type PermissionFilter

type PermissionFilter struct {
	// contains filtered or unexported fields
}

func (*PermissionFilter) Searcher

type QueryExtender

type QueryExtender interface {
	GetFramer(frame *data.Frame) FramerFunc
}

type ResourceFilter

type ResourceFilter func(kind entityKind, uid, parentUID string) bool

ResourceFilter checks if a given a uid (resource identifier) check if we have the requested permission

type SearchHTTPService

type SearchHTTPService interface {
	RegisterHTTPRoutes(storageRoute routing.RouteRegister)
}

func ProvideSearchHTTPService

func ProvideSearchHTTPService(search SearchService) SearchHTTPService

type SearchService

type SearchService interface {
	registry.CanBeDisabled
	registry.BackgroundService
	DoDashboardQuery(ctx context.Context, user *backend.User, orgId int64, query DashboardQuery) *backend.DataResponse

	IsReady(ctx context.Context, orgId int64) IsSearchReadyResponse
	RegisterDashboardIndexExtender(ext DashboardIndexExtender)
	TriggerReIndex()
	// contains filtered or unexported methods
}

func NewStubSearchService

func NewStubSearchService() SearchService

func ProvideService

func ProvideService(cfg *setting.Cfg, sql db.DB, entityEventStore store.EntityEventsService,
	ac accesscontrol.Service, tracer tracing.Tracer, features featuremgmt.FeatureToggles, orgService org.Service,
	userService user.Service, folderService folder.Service) SearchService

type StandardSearchService

type StandardSearchService struct {
	registry.BackgroundService
	// contains filtered or unexported fields
}

func (*StandardSearchService) DoDashboardQuery

func (s *StandardSearchService) DoDashboardQuery(ctx context.Context, user *backend.User, orgID int64, q DashboardQuery) *backend.DataResponse

func (*StandardSearchService) IsDisabled

func (s *StandardSearchService) IsDisabled() bool

func (*StandardSearchService) IsReady

func (*StandardSearchService) RegisterDashboardIndexExtender

func (s *StandardSearchService) RegisterDashboardIndexExtender(ext DashboardIndexExtender)

func (*StandardSearchService) Run

func (*StandardSearchService) TriggerReIndex

func (s *StandardSearchService) TriggerReIndex()

type SubstringQuery

type SubstringQuery struct {
	// contains filtered or unexported fields
}

func NewSubstringQuery

func NewSubstringQuery(wildcard string) *SubstringQuery

func (*SubstringQuery) Boost

func (q *SubstringQuery) Boost() float64

func (*SubstringQuery) Field

func (q *SubstringQuery) Field() string

func (*SubstringQuery) Searcher

func (*SubstringQuery) SetBoost

func (q *SubstringQuery) SetBoost(b float64) *SubstringQuery

func (*SubstringQuery) SetField

func (q *SubstringQuery) SetField(f string) *SubstringQuery

func (*SubstringQuery) Validate

func (q *SubstringQuery) Validate() error

func (*SubstringQuery) Wildcard

func (q *SubstringQuery) Wildcard() string

Wildcard returns the substring being queried

Jump to

Keyboard shortcuts

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