Documentation ¶
Index ¶
- func ExtractCertaintyFromParams(params GetParams) (certainty float64)
- func ExtractDistanceFromParams(params GetParams) (distance float64, withDistance bool)
- type ExploreParams
- type Explorer
- func (e *Explorer) CrossClassVectorSearch(ctx context.Context, params ExploreParams) ([]search.Result, error)
- func (e *Explorer) GetClass(ctx context.Context, params GetParams) ([]interface{}, error)
- func (e *Explorer) Hybrid(ctx context.Context, params GetParams) ([]search.Result, error)
- func (e *Explorer) SetSchemaGetter(sg uc.SchemaGetter)
- type GetParams
- type GroupParams
- 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 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 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(search vectorClassSearch, logger logrus.FieldLogger, modulesProvider ModulesProvider, metrics explorerMetrics, ) *Explorer
NewExplorer with search and connector repo
func (*Explorer) CrossClassVectorSearch ¶
func (*Explorer) SetSchemaGetter ¶
func (e *Explorer) SetSchemaGetter(sg uc.SchemaGetter)
type GetParams ¶
type GetParams struct { Filters *filters.LocalFilter ClassName string Pagination *filters.Pagination Sort []filters.Sort Properties search.SelectProperties NearVector *searchparams.NearVector NearObject *searchparams.NearObject KeywordRanking *searchparams.KeywordRanking HybridSearch *searchparams.HybridSearch SearchVector []float32 Group *GroupParams ModuleParams map[string]interface{} AdditionalProperties additional.Properties }
type GroupParams ¶
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) ([]float32, error) CrossClassVectorFromSearchParam(ctx context.Context, param string, params interface{}, findVectorFn modulecapabilities.FindVectorFn) ([]float32, 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 string, input 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 // Certaintiy 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 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, *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 { VectorSearch(ctx context.Context, vector []float32, offset, limit int, filters *filters.LocalFilter) ([]search.Result, error) Aggregate(ctx context.Context, params aggregation.Params) (*aggregation.Result, error) Object(ctx context.Context, className string, id strfmt.UUID, props search.SelectProperties, additional additional.Properties, properties *additional.ReplicationProperties) (*search.Result, error) ObjectsByID(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (search.Results, error) }
Source Files ¶
- aggregate_type_inspector.go
- explorer.go
- explorer_validate_filters.go
- explorer_validate_sort.go
- metrics.go
- near_params_vector.go
- traverser.go
- traverser_aggregate.go
- traverser_explore_concepts.go
- traverser_get.go
- traverser_get_params.go
- traverser_schema_search_params.go
- traverser_validate_distance_metrics.go