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) GetClassByName(className string) *models.Class
- 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) (interface{}, 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 TraverserRepo
- 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) GetClassByName ¶ added in v1.25.0
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 VectorFromSearchParam(ctx context.Context, className string, param string, params interface{}, findVectorFn modulecapabilities.FindVectorFn, tenant string) ([]float32, string, error) CrossClassVectorFromSearchParam(ctx context.Context, param string, params interface{}, findVectorFn modulecapabilities.FindVectorFn) ([]float32, string, error) GetExploreAdditionalExtend(ctx context.Context, in []search.Result, moduleParams map[string]interface{}, searchVector []float32, 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) }
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) GetTargetVectorFromParams ¶ added in v1.24.5
func (t *TargetVectorParamHelper) GetTargetVectorFromParams(params dto.GetParams) string
func (*TargetVectorParamHelper) GetTargetVectorOrDefault ¶ added in v1.24.5
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, locks locks, logger logrus.FieldLogger, authorizer 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, ) (interface{}, error)
Aggregate resolves meta queries
type TraverserRepo ¶
type TraverserRepo interface { GetClass(context.Context, *dto.GetParams) (interface{}, error) Aggregate(context.Context, *aggregation.Params) (interface{}, error) }
TraverserRepo describes the dependencies of the Traverser UC to the connected database
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
¶
- aggregate_type_inspector.go
- explorer.go
- explorer_hybrid.go
- explorer_validate_filters.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