query

package
v1.27.7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TenantOffLoadingStatus = "FROZEN"
)

Variables

View Source
var (
	ErrInvalidTenant = errors.New("invalid tenant status")
)

Functions

This section is empty.

Types

type API

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

API is the core query API that is transport agnostic (http, grpc, etc).

func NewAPI

func NewAPI(
	schema SchemaQuerier,
	offload *modsloads3.Module,
	vectorizer text2vecbase.TextVectorizer,
	stopwords *stopwords.Detector,
	config *Config,
	log logrus.FieldLogger,
) *API

func (*API) Search

func (a *API) Search(ctx context.Context, req *SearchRequest) (*SearchResponse, error)

Search serves vector search over the offloaded tenant on object storage.

type Config

type Config struct {
	GRPCListenAddr string `long:"grpc.listen" description:"gRPC address that query node listens at" default:"0.0.0.0:9091"`
	SchemaAddr     string `long:"schema.addr" description:"address to get schema information" default:"http://0.0.0.0:8080"`
	S3URL          string `long:"s3.url" description:"s3 URL to query offloaded tenants (e.g: s3://<url>)"`
	S3Endpoint     string `long:"s3.endpoint" description:"s3 endpoint to if mocking s3 (e.g: via minio)"`

	// NOTE(kavi): This `DataPath` makes `querier` statefulset. Depend on disk to serve query reqeust.
	// Main rationale is, we first download the objects from object store and put it on local disk
	// We need this, to make it work with existing query helpers, where we assume we serve query from
	// local disk. This will go away eventually once we start reading from object store into memory directly.
	DataPath string `long:"datapath" description:"place to look for tenant data after downloading it from object storage" default:"/tmp"`

	VectorizerAddr string `long:"vectorize-addr" description:"vectorizer address to be used to vectorize near-text query" default:"0.0.0.0:9999"`
}

Config represents any type of configs and flags to control the querier

type GRPC

type GRPC struct {

	// TODO(kavi): This should go away once we split v1.WeaviateServer into composable v1.Searcher
	protocol.UnimplementedWeaviateServer
	// contains filtered or unexported fields
}

GRPC transport on top of the query.API.

func NewGRPC

func NewGRPC(api *API, schema SchemaQuerier, log logrus.FieldLogger) *GRPC

func (*GRPC) Search

type Result

type Result struct {
	Obj       *storobj.Object
	Certainty float64
}

type SchemaQuerier

type SchemaQuerier interface {
	TenantStatus(ctx context.Context, collection, tenant string) (string, error)
	Collection(ctx context.Context, collection string) (*models.Class, error)
}

type SearchRequest

type SearchRequest struct {
	Collection string
	// if class is not nil, try avoid getting the class again from schema
	Class     *models.Class
	Tenant    string
	NearText  []string // vector search
	Certainty float64  // threshold to match with certainty of vectors match
	Limit     int
	Filters   *filters.LocalFilter
}

type SearchResponse

type SearchResponse struct {
	Results []Result
}

Jump to

Keyboard shortcuts

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