Documentation
¶
Index ¶
- func ExtractCertaintyFromParams(params dto.GetParams) (certainty float64)
- func ExtractDistanceFromParams(params dto.GetParams) (distance float64, withDistance bool)
- func MaxInt(ints ...int) int
- func MinInt(ints ...int) int
- type ExploreParams
- type Explorer
- func (e *Explorer) CalculateTotalLimit(pagination *filters.Pagination) (int, error)
- func (e *Explorer) CrossClassVectorSearch(ctx context.Context, params ExploreParams) ([]search.Result, error)
- func (e *Explorer) GetClass(ctx context.Context, params dto.GetParams) ([]interface{}, error)
- func (e *Explorer) GetSchema() schema.Schema
- func (e *Explorer) Hybrid(ctx context.Context, params dto.GetParams) ([]search.Result, error)
- func (e *Explorer) SetSchemaGetter(sg uc.SchemaGetter)
- type Metrics
- func (m *Metrics) AddUsageDimensions(className, queryType, operation string, dims int)
- func (m *Metrics) QueriesAggregateDec(className string)
- func (m *Metrics) QueriesAggregateInc(className string)
- func (m *Metrics) QueriesGetDec(className string)
- func (m *Metrics) QueriesGetInc(className string)
- func (m *Metrics) QueriesObserveDuration(className string, startMs int64)
- type ModulesProvider
- type SearchParams
- type SearchResult
- type SearchResults
- type SearchType
- type TargetVectorParamHelper
- type Traverser
- func (t *Traverser) Aggregate(ctx context.Context, principal *models.Principal, params *aggregation.Params) (any, error)
- func (t *Traverser) Explore(ctx context.Context, principal *models.Principal, params ExploreParams) ([]search.Result, error)
- func (t *Traverser) GetClass(ctx context.Context, principal *models.Principal, params dto.GetParams) ([]interface{}, error)
- type VectorSearcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExploreParams ¶
type ExploreParams struct {
NearVector *searchparams.NearVector
NearObject *searchparams.NearObject
Offset int
Limit int
ModuleParams map[string]interface{}
WithCertaintyProp bool
}
ExploreParams are the parameters used by the GraphQL `Explore { }` API
type Explorer ¶
type Explorer struct {
// contains filtered or unexported fields
}
Explorer is a helper construct to perform vector-based searches. It does not contain monitoring or authorization checks. It should thus never be directly used by an API, but through a Traverser.
func NewExplorer ¶
func NewExplorer(searcher objectsSearcher, logger logrus.FieldLogger, modulesProvider ModulesProvider, metrics explorerMetrics, conf config.Config) *Explorer
NewExplorer with search and connector repo
func (*Explorer) CalculateTotalLimit ¶ added in v1.20.4
func (e *Explorer) CalculateTotalLimit(pagination *filters.Pagination) (int, error)
func (*Explorer) CrossClassVectorSearch ¶
func (*Explorer) Hybrid ¶
Hybrid search. This is the main entry point to the hybrid search algorithm
func (*Explorer) SetSchemaGetter ¶
func (e *Explorer) SetSchemaGetter(sg uc.SchemaGetter)
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(prom *monitoring.PrometheusMetrics) *Metrics
func (*Metrics) AddUsageDimensions ¶
func (*Metrics) QueriesAggregateDec ¶
func (*Metrics) QueriesAggregateInc ¶
func (*Metrics) QueriesGetDec ¶
func (*Metrics) QueriesGetInc ¶
func (*Metrics) QueriesObserveDuration ¶
type ModulesProvider ¶
type ModulesProvider interface {
ValidateSearchParam(name string, value interface{}, className string) error
CrossClassValidateSearchParam(name string, value interface{}) error
IsTargetVectorMultiVector(className, targetVector string) (bool, error)
VectorFromSearchParam(ctx context.Context, className, targetVector, tenant, param string, params interface{},
findVectorFn modulecapabilities.FindVectorFn[[]float32]) ([]float32, error)
MultiVectorFromSearchParam(ctx context.Context, className, targetVector, tenant, param string, params interface{},
findVectorFn modulecapabilities.FindVectorFn[[][]float32]) ([][]float32, error)
TargetsFromSearchParam(className string, params interface{}) ([]string, error)
CrossClassVectorFromSearchParam(ctx context.Context, param string,
params interface{}, findVectorFn modulecapabilities.FindVectorFn[[]float32]) ([]float32, string, error)
MultiCrossClassVectorFromSearchParam(ctx context.Context, param string,
params interface{}, findVectorFn modulecapabilities.FindVectorFn[[][]float32]) ([][]float32, string, error)
GetExploreAdditionalExtend(ctx context.Context, in []search.Result,
moduleParams map[string]interface{}, searchVector models.Vector,
argumentModuleParams map[string]interface{}) ([]search.Result, error)
ListExploreAdditionalExtend(ctx context.Context, in []search.Result,
moduleParams map[string]interface{},
argumentModuleParams map[string]interface{}) ([]search.Result, error)
VectorFromInput(ctx context.Context, className, input, targetVector string) ([]float32, error)
MultiVectorFromInput(ctx context.Context, className, input, targetVector string) ([][]float32, error)
}
type SearchParams ¶
type SearchParams struct {
// SearchType can be SearchTypeClass or SearchTypeProperty
SearchType SearchType
// Name is the string-representation of the class or property name
Name string
// Certainty must be a value between 0 and 1. The higher it is the narrower
// is the search, the lower it is, the wider the search is
Certainty float32
}
SearchParams to be used for a SchemaSearch. See individual properties for additional documentation on what they do
func (SearchParams) Validate ¶
func (p SearchParams) Validate() error
Validate the feasibility of the specified arguments
type SearchResult ¶
SearchResult is a single search result. See wrapping Search Results for the Type
type SearchResults ¶
type SearchResults struct {
Type SearchType
Results []SearchResult
}
SearchResults is grouping of SearchResults for a SchemaSearch
type SearchType ¶
type SearchType string
SearchType to search for either class names or property names
const ( // SearchTypeClass to search the contextionary for class names SearchTypeClass SearchType = "class" // SearchTypeProperty to search the contextionary for property names SearchTypeProperty SearchType = "property" )
type TargetVectorParamHelper ¶ added in v1.24.5
type TargetVectorParamHelper struct{}
func NewTargetParamHelper ¶ added in v1.24.5
func NewTargetParamHelper() *TargetVectorParamHelper
func (*TargetVectorParamHelper) GetTargetVectorOrDefault ¶ added in v1.24.5
func (t *TargetVectorParamHelper) GetTargetVectorOrDefault(getClass func(string) *models.Class, className string, targetVectors []string) ([]string, error)
GetTargetVectorOrDefault returns the caller's target vectors unchanged when any were supplied. Only when none were supplied does it read the single class via getClass to derive the default target vector, so callers that already have target vectors read no class at all.
func (*TargetVectorParamHelper) GetTargetVectorsFromParams ¶ added in v1.26.0
func (t *TargetVectorParamHelper) GetTargetVectorsFromParams(params dto.GetParams) []string
type Traverser ¶
type Traverser struct {
// contains filtered or unexported fields
}
Traverser can be used to dynamically traverse the knowledge graph
func NewTraverser ¶
func NewTraverser(config *config.WeaviateConfig, logger logrus.FieldLogger, authorizer authorization.Authorizer, vectorSearcher VectorSearcher, explorer explorer, schemaGetter schema.SchemaGetter, modulesProvider ModulesProvider, metrics *Metrics, maxGetRequests int, ) *Traverser
NewTraverser to traverse the knowledge graph
func (*Traverser) Aggregate ¶
func (t *Traverser) Aggregate(ctx context.Context, principal *models.Principal, params *aggregation.Params) (any, error)
Aggregate resolves meta queries
type VectorSearcher ¶
type VectorSearcher interface {
Aggregate(ctx context.Context, params aggregation.Params, modules *modules.Provider) (*aggregation.Result, error)
Object(ctx context.Context, className string, id strfmt.UUID,
props search.SelectProperties, additional additional.Properties,
properties *additional.ReplicationProperties, tenant string) (*search.Result, error)
ObjectsByID(ctx context.Context, id strfmt.UUID, props search.SelectProperties,
additional additional.Properties, tenant string) (search.Results, error)
}
Source Files
¶
- explorer.go
- explorer_hybrid.go
- explorer_validate_scroll.go
- explorer_validate_sort.go
- hybrid_group_by.go
- metrics.go
- near_params_vector.go
- target_vector_param_helper.go
- traverser.go
- traverser_aggregate.go
- traverser_explore_concepts.go
- traverser_get.go
- traverser_schema_search_params.go
- traverser_validate_distance_metrics.go