Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func PrettyPrint(v any) string
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AggregateBy
- type AggregateByCount
- type AggregationGroup
- type AttributeSchemaConfig
- type AttributeSchemaConfigParam
- type AttributeType
- type Bm25ClauseParams
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Namespace(namespace string) Namespace
- func (r *Client) Namespaces(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) (res *pagination.NamespacePage[NamespaceSummary], err error)
- func (r *Client) NamespacesAutoPaging(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) *pagination.NamespacePageAutoPager[NamespaceSummary]
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ColumnsParam
- type ContainsAllTokensFilterParams
- type DistanceMetric
- type Error
- type Expr
- type ExprRefNew
- type Filter
- type FilterAnd
- type FilterAnyGt
- type FilterAnyGte
- type FilterAnyLt
- type FilterAnyLte
- type FilterContains
- type FilterContainsAllTokens
- type FilterContainsAllTokensArray
- type FilterContainsAllTokensArrayWithParams
- type FilterContainsAllTokensWithParams
- type FilterContainsAny
- type FilterEq
- type FilterGlob
- type FilterGt
- type FilterGte
- type FilterIGlob
- type FilterIn
- type FilterLt
- type FilterLte
- type FilterNot
- type FilterNotContains
- type FilterNotContainsAny
- type FilterNotEq
- type FilterNotGlob
- type FilterNotIGlob
- type FilterNotIn
- type FilterOr
- type FilterRegex
- type FullTextSearchConfig
- type FullTextSearchConfigParam
- type ID
- type IDParam
- type IncludeAttributesParam
- type Language
- type Namespace
- type NamespaceDeleteAllParams
- type NamespaceDeleteAllResponse
- type NamespaceExplainQueryParams
- type NamespaceExplainQueryParamsConsistency
- type NamespaceExplainQueryParamsConsistencyLevel
- type NamespaceExplainQueryResponse
- type NamespaceHintCacheWarmParams
- type NamespaceHintCacheWarmResponse
- type NamespaceMetadata
- type NamespaceMetadataParams
- type NamespaceMultiQueryParams
- type NamespaceMultiQueryParamsConsistency
- type NamespaceMultiQueryParamsConsistencyLevel
- type NamespaceMultiQueryResponse
- type NamespaceMultiQueryResponseResult
- type NamespaceQueryParams
- type NamespaceQueryParamsConsistency
- type NamespaceQueryParamsConsistencyLevel
- type NamespaceQueryResponse
- type NamespaceRecallParams
- type NamespaceRecallResponse
- type NamespaceRecallResponseGroundTruth
- type NamespaceSchemaParams
- type NamespaceSchemaResponse
- type NamespaceService
- func (r *NamespaceService) DeleteAll(ctx context.Context, body NamespaceDeleteAllParams, ...) (res *NamespaceDeleteAllResponse, err error)
- func (r *NamespaceService) ExplainQuery(ctx context.Context, params NamespaceExplainQueryParams, ...) (res *NamespaceExplainQueryResponse, err error)
- func (r *NamespaceService) HintCacheWarm(ctx context.Context, query NamespaceHintCacheWarmParams, ...) (res *NamespaceHintCacheWarmResponse, err error)
- func (r *NamespaceService) ID() string
- func (r *NamespaceService) Metadata(ctx context.Context, query NamespaceMetadataParams, ...) (res *NamespaceMetadata, err error)
- func (r *NamespaceService) MultiQuery(ctx context.Context, params NamespaceMultiQueryParams, ...) (res *NamespaceMultiQueryResponse, err error)
- func (r *NamespaceService) Query(ctx context.Context, params NamespaceQueryParams, opts ...option.RequestOption) (res *NamespaceQueryResponse, err error)
- func (r *NamespaceService) Recall(ctx context.Context, params NamespaceRecallParams, ...) (res *NamespaceRecallResponse, err error)
- func (r *NamespaceService) Schema(ctx context.Context, query NamespaceSchemaParams, opts ...option.RequestOption) (res *NamespaceSchemaResponse, err error)
- func (r *NamespaceService) UpdateSchema(ctx context.Context, params NamespaceUpdateSchemaParams, ...) (res *NamespaceUpdateSchemaResponse, err error)
- func (r *NamespaceService) Write(ctx context.Context, params NamespaceWriteParams, opts ...option.RequestOption) (res *NamespaceWriteResponse, err error)
- type NamespaceSummary
- type NamespaceUpdateSchemaParams
- type NamespaceUpdateSchemaResponse
- type NamespaceWriteParams
- type NamespaceWriteParamsEncryption
- type NamespaceWriteParamsEncryptionCmek
- type NamespaceWriteResponse
- type NamespacesParams
- type QueryBilling
- type QueryParam
- type QueryPerformance
- type RankBy
- type RankByAttribute
- type RankByAttributeOrder
- type RankByText
- type RankByTextBM25
- type RankByTextBM25Array
- type RankByTextBM25ArrayWithParams
- type RankByTextBM25WithParams
- type RankByTextMax
- type RankByTextProduct
- type RankByTextSum
- type RankByVector
- type Row
- type RowParam
- type Tokenizer
- type Vector
- type VectorEncoding
- type VectorParam
- type WriteBilling
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (TURBOPUFFER_API_KEY, TURBOPUFFER_REGION, TURBOPUFFER_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
func PrettyPrint ¶
PrettyPrint pretty prints a JSON-encodable value to a string.
Types ¶
type AggregateBy ¶
type AggregateBy interface {
// contains filtered or unexported methods
}
type AggregateByCount ¶
type AggregateByCount struct { }
func NewAggregateByCount ¶
func NewAggregateByCount() AggregateByCount
func (AggregateByCount) MarshalJSON ¶
func (v AggregateByCount) MarshalJSON() ([]byte, error)
type AggregationGroup ¶ added in v1.2.0
type AttributeSchemaConfig ¶
type AttributeSchemaConfig struct { // Whether to create an approximate nearest neighbor index for the attribute. Ann bool `json:"ann"` // Whether or not the attributes can be used in filters. Filterable bool `json:"filterable"` // Whether this attribute can be used as part of a BM25 full-text search. Requires // the `string` or `[]string` type, and by default, BM25-enabled attributes are not // filterable. You can override this by setting `filterable: true`. FullTextSearch FullTextSearchConfig `json:"full_text_search"` // Whether to enable Regex filters on this attribute. Regex bool `json:"regex"` // The data type of the attribute. Valid values: string, int, uint, uuid, datetime, // bool, []string, []int, []uint, []uuid, []datetime, [DIMS]f16, [DIMS]f32. Type AttributeType `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Ann respjson.Field Filterable respjson.Field FullTextSearch respjson.Field Regex respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Detailed configuration for an attribute attached to a document.
func (AttributeSchemaConfig) RawJSON ¶
func (r AttributeSchemaConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (AttributeSchemaConfig) ToParam ¶
func (r AttributeSchemaConfig) ToParam() AttributeSchemaConfigParam
ToParam converts this AttributeSchemaConfig to a AttributeSchemaConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AttributeSchemaConfigParam.Overrides()
func (*AttributeSchemaConfig) UnmarshalJSON ¶
func (r *AttributeSchemaConfig) UnmarshalJSON(data []byte) error
type AttributeSchemaConfigParam ¶
type AttributeSchemaConfigParam struct { // Whether to create an approximate nearest neighbor index for the attribute. Ann param.Opt[bool] `json:"ann,omitzero"` // Whether or not the attributes can be used in filters. Filterable param.Opt[bool] `json:"filterable,omitzero"` // Whether to enable Regex filters on this attribute. Regex param.Opt[bool] `json:"regex,omitzero"` // The data type of the attribute. Valid values: string, int, uint, uuid, datetime, // bool, []string, []int, []uint, []uuid, []datetime, [DIMS]f16, [DIMS]f32. Type param.Opt[AttributeType] `json:"type,omitzero"` // Whether this attribute can be used as part of a BM25 full-text search. Requires // the `string` or `[]string` type, and by default, BM25-enabled attributes are not // filterable. You can override this by setting `filterable: true`. FullTextSearch *FullTextSearchConfigParam `json:"full_text_search,omitzero"` // contains filtered or unexported fields }
Detailed configuration for an attribute attached to a document.
func (AttributeSchemaConfigParam) MarshalJSON ¶
func (r AttributeSchemaConfigParam) MarshalJSON() (data []byte, err error)
func (*AttributeSchemaConfigParam) UnmarshalJSON ¶
func (r *AttributeSchemaConfigParam) UnmarshalJSON(data []byte) error
type AttributeType ¶
type AttributeType = string
type Bm25ClauseParams ¶ added in v1.2.0
type Bm25ClauseParams struct { // Whether to treat the last token in the query input as a literal prefix. LastAsPrefix param.Opt[bool] `json:"last_as_prefix,omitzero"` // contains filtered or unexported fields }
Additional (optional) parameters for a single BM25 query clause.
func (Bm25ClauseParams) MarshalJSON ¶ added in v1.2.0
func (r Bm25ClauseParams) MarshalJSON() (data []byte, err error)
func (*Bm25ClauseParams) UnmarshalJSON ¶ added in v1.2.0
func (r *Bm25ClauseParams) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
}
Client creates a struct with services and top level methods that help with interacting with the turbopuffer API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (TURBOPUFFER_API_KEY, TURBOPUFFER_REGION, TURBOPUFFER_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Namespaces ¶
func (r *Client) Namespaces(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) (res *pagination.NamespacePage[NamespaceSummary], err error)
List namespaces.
func (*Client) NamespacesAutoPaging ¶
func (r *Client) NamespacesAutoPaging(ctx context.Context, query NamespacesParams, opts ...option.RequestOption) *pagination.NamespacePageAutoPager[NamespaceSummary]
List namespaces.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ColumnsParam ¶
A list of documents in columnar format. Each key is a column name, mapped to an array of values for that column.
type ContainsAllTokensFilterParams ¶ added in v1.2.0
type ContainsAllTokensFilterParams struct { // Whether to treat the last token in the query input as a literal prefix. LastAsPrefix param.Opt[bool] `json:"last_as_prefix,omitzero"` // contains filtered or unexported fields }
Additional (optional) parameters for the ContainsAllTokens filter.
func (ContainsAllTokensFilterParams) MarshalJSON ¶ added in v1.2.0
func (r ContainsAllTokensFilterParams) MarshalJSON() (data []byte, err error)
func (*ContainsAllTokensFilterParams) UnmarshalJSON ¶ added in v1.2.0
func (r *ContainsAllTokensFilterParams) UnmarshalJSON(data []byte) error
type DistanceMetric ¶
type DistanceMetric string
A function used to calculate vector similarity.
const ( DistanceMetricCosineDistance DistanceMetric = "cosine_distance" DistanceMetricEuclideanSquared DistanceMetric = "euclidean_squared" )
type ExprRefNew ¶ added in v0.1.4
type ExprRefNew struct {
// contains filtered or unexported fields
}
func NewExprRefNew ¶ added in v0.1.4
func NewExprRefNew( refNew string, ) ExprRefNew
func (ExprRefNew) MarshalJSON ¶ added in v0.1.4
func (v ExprRefNew) MarshalJSON() ([]byte, error)
type FilterAnd ¶
type FilterAnd struct {
// contains filtered or unexported fields
}
func NewFilterAnd ¶
func (FilterAnd) MarshalJSON ¶
type FilterAnyGt ¶ added in v1.2.0
type FilterAnyGt struct {
// contains filtered or unexported fields
}
func NewFilterAnyGt ¶ added in v1.2.0
func NewFilterAnyGt( attr string, value any, ) FilterAnyGt
func (FilterAnyGt) MarshalJSON ¶ added in v1.2.0
func (v FilterAnyGt) MarshalJSON() ([]byte, error)
type FilterAnyGte ¶ added in v1.2.0
type FilterAnyGte struct {
// contains filtered or unexported fields
}
func NewFilterAnyGte ¶ added in v1.2.0
func NewFilterAnyGte( attr string, value any, ) FilterAnyGte
func (FilterAnyGte) MarshalJSON ¶ added in v1.2.0
func (v FilterAnyGte) MarshalJSON() ([]byte, error)
type FilterAnyLt ¶ added in v1.2.0
type FilterAnyLt struct {
// contains filtered or unexported fields
}
func NewFilterAnyLt ¶ added in v1.2.0
func NewFilterAnyLt( attr string, value any, ) FilterAnyLt
func (FilterAnyLt) MarshalJSON ¶ added in v1.2.0
func (v FilterAnyLt) MarshalJSON() ([]byte, error)
type FilterAnyLte ¶ added in v1.2.0
type FilterAnyLte struct {
// contains filtered or unexported fields
}
func NewFilterAnyLte ¶ added in v1.2.0
func NewFilterAnyLte( attr string, value any, ) FilterAnyLte
func (FilterAnyLte) MarshalJSON ¶ added in v1.2.0
func (v FilterAnyLte) MarshalJSON() ([]byte, error)
type FilterContains ¶ added in v0.1.5
type FilterContains struct {
// contains filtered or unexported fields
}
func NewFilterContains ¶ added in v0.1.5
func NewFilterContains( attr string, value any, ) FilterContains
func (FilterContains) MarshalJSON ¶ added in v0.1.5
func (v FilterContains) MarshalJSON() ([]byte, error)
type FilterContainsAllTokens ¶
type FilterContainsAllTokens struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokens ¶
func NewFilterContainsAllTokens( attr string, value string, ) FilterContainsAllTokens
func (FilterContainsAllTokens) MarshalJSON ¶
func (v FilterContainsAllTokens) MarshalJSON() ([]byte, error)
type FilterContainsAllTokensArray ¶ added in v0.1.4
type FilterContainsAllTokensArray struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokensArray ¶ added in v0.1.4
func NewFilterContainsAllTokensArray( attr string, value []string, ) FilterContainsAllTokensArray
func (FilterContainsAllTokensArray) MarshalJSON ¶ added in v0.1.4
func (v FilterContainsAllTokensArray) MarshalJSON() ([]byte, error)
type FilterContainsAllTokensArrayWithParams ¶ added in v1.2.0
type FilterContainsAllTokensArrayWithParams struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokensArrayWithParams ¶ added in v1.2.0
func NewFilterContainsAllTokensArrayWithParams( attr string, value []string, params ContainsAllTokensFilterParams, ) FilterContainsAllTokensArrayWithParams
func (FilterContainsAllTokensArrayWithParams) MarshalJSON ¶ added in v1.2.0
func (v FilterContainsAllTokensArrayWithParams) MarshalJSON() ([]byte, error)
type FilterContainsAllTokensWithParams ¶ added in v1.2.0
type FilterContainsAllTokensWithParams struct {
// contains filtered or unexported fields
}
func NewFilterContainsAllTokensWithParams ¶ added in v1.2.0
func NewFilterContainsAllTokensWithParams( attr string, value string, params ContainsAllTokensFilterParams, ) FilterContainsAllTokensWithParams
func (FilterContainsAllTokensWithParams) MarshalJSON ¶ added in v1.2.0
func (v FilterContainsAllTokensWithParams) MarshalJSON() ([]byte, error)
type FilterContainsAny ¶ added in v0.1.5
type FilterContainsAny[T any] struct { // contains filtered or unexported fields }
func NewFilterContainsAny ¶ added in v0.1.5
func NewFilterContainsAny[T any]( attr string, value []T, ) FilterContainsAny[T]
func (FilterContainsAny[T]) MarshalJSON ¶ added in v0.1.5
func (v FilterContainsAny[T]) MarshalJSON() ([]byte, error)
type FilterEq ¶
type FilterEq struct {
// contains filtered or unexported fields
}
func NewFilterEq ¶
func (FilterEq) MarshalJSON ¶
type FilterGlob ¶
type FilterGlob struct {
// contains filtered or unexported fields
}
func NewFilterGlob ¶
func NewFilterGlob( attr string, value string, ) FilterGlob
func (FilterGlob) MarshalJSON ¶
func (v FilterGlob) MarshalJSON() ([]byte, error)
type FilterGt ¶
type FilterGt struct {
// contains filtered or unexported fields
}
func NewFilterGt ¶
func (FilterGt) MarshalJSON ¶
type FilterGte ¶
type FilterGte struct {
// contains filtered or unexported fields
}
func NewFilterGte ¶
func (FilterGte) MarshalJSON ¶
type FilterIGlob ¶
type FilterIGlob struct {
// contains filtered or unexported fields
}
func NewFilterIGlob ¶
func NewFilterIGlob( attr string, value string, ) FilterIGlob
func (FilterIGlob) MarshalJSON ¶
func (v FilterIGlob) MarshalJSON() ([]byte, error)
type FilterIn ¶
type FilterIn[T any] struct { // contains filtered or unexported fields }
func NewFilterIn ¶
func (FilterIn[T]) MarshalJSON ¶
type FilterLt ¶
type FilterLt struct {
// contains filtered or unexported fields
}
func NewFilterLt ¶
func (FilterLt) MarshalJSON ¶
type FilterLte ¶
type FilterLte struct {
// contains filtered or unexported fields
}
func NewFilterLte ¶
func (FilterLte) MarshalJSON ¶
type FilterNot ¶
type FilterNot struct {
// contains filtered or unexported fields
}
func NewFilterNot ¶
func (FilterNot) MarshalJSON ¶
type FilterNotContains ¶ added in v0.1.5
type FilterNotContains struct {
// contains filtered or unexported fields
}
func NewFilterNotContains ¶ added in v0.1.5
func NewFilterNotContains( attr string, value any, ) FilterNotContains
func (FilterNotContains) MarshalJSON ¶ added in v0.1.5
func (v FilterNotContains) MarshalJSON() ([]byte, error)
type FilterNotContainsAny ¶ added in v0.1.5
type FilterNotContainsAny[T any] struct { // contains filtered or unexported fields }
func NewFilterNotContainsAny ¶ added in v0.1.5
func NewFilterNotContainsAny[T any]( attr string, value []T, ) FilterNotContainsAny[T]
func (FilterNotContainsAny[T]) MarshalJSON ¶ added in v0.1.5
func (v FilterNotContainsAny[T]) MarshalJSON() ([]byte, error)
type FilterNotEq ¶
type FilterNotEq struct {
// contains filtered or unexported fields
}
func NewFilterNotEq ¶
func NewFilterNotEq( attr string, value any, ) FilterNotEq
func (FilterNotEq) MarshalJSON ¶
func (v FilterNotEq) MarshalJSON() ([]byte, error)
type FilterNotGlob ¶
type FilterNotGlob struct {
// contains filtered or unexported fields
}
func NewFilterNotGlob ¶
func NewFilterNotGlob( attr string, value string, ) FilterNotGlob
func (FilterNotGlob) MarshalJSON ¶
func (v FilterNotGlob) MarshalJSON() ([]byte, error)
type FilterNotIGlob ¶
type FilterNotIGlob struct {
// contains filtered or unexported fields
}
func NewFilterNotIGlob ¶
func NewFilterNotIGlob( attr string, value string, ) FilterNotIGlob
func (FilterNotIGlob) MarshalJSON ¶
func (v FilterNotIGlob) MarshalJSON() ([]byte, error)
type FilterNotIn ¶
type FilterNotIn[T any] struct { // contains filtered or unexported fields }
func NewFilterNotIn ¶
func NewFilterNotIn[T any]( attr string, value []T, ) FilterNotIn[T]
func (FilterNotIn[T]) MarshalJSON ¶
func (v FilterNotIn[T]) MarshalJSON() ([]byte, error)
type FilterOr ¶
type FilterOr struct {
// contains filtered or unexported fields
}
func NewFilterOr ¶
func (FilterOr) MarshalJSON ¶
type FilterRegex ¶ added in v0.1.12
type FilterRegex struct {
// contains filtered or unexported fields
}
func NewFilterRegex ¶ added in v0.1.12
func NewFilterRegex( attr string, value string, ) FilterRegex
func (FilterRegex) MarshalJSON ¶ added in v0.1.12
func (v FilterRegex) MarshalJSON() ([]byte, error)
type FullTextSearchConfig ¶
type FullTextSearchConfig struct { // The `b` document length normalization parameter for BM25. Defaults to `0.75`. B float64 `json:"b"` // Whether searching is case-sensitive. Defaults to `false` (i.e. // case-insensitive). CaseSensitive bool `json:"case_sensitive"` // The `k1` term saturation parameter for BM25. Defaults to `1.2`. K1 float64 `json:"k1"` // Describes the language of a text attribute. Defaults to `english`. // // Any of "arabic", "danish", "dutch", "english", "finnish", "french", "german", // "greek", "hungarian", "italian", "norwegian", "portuguese", "romanian", // "russian", "spanish", "swedish", "tamil", "turkish". Language Language `json:"language"` // Maximum length of a token in bytes. Tokens larger than this value during // tokenization will be filtered out. Has to be between `1` and `254` (inclusive). // Defaults to `39`. MaxTokenLength int64 `json:"max_token_length"` // Removes common words from the text based on language. Defaults to `true` (i.e. // remove common words). RemoveStopwords bool `json:"remove_stopwords"` // Language-specific stemming for the text. Defaults to `false` (i.e., do not // stem). Stemming bool `json:"stemming"` // The tokenizer to use for full-text search on an attribute. Defaults to // `word_v2`. // // Any of "pre_tokenized_array", "word_v0", "word_v1", "word_v2". Tokenizer Tokenizer `json:"tokenizer"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { B respjson.Field CaseSensitive respjson.Field K1 respjson.Field Language respjson.Field MaxTokenLength respjson.Field RemoveStopwords respjson.Field Stemming respjson.Field Tokenizer respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Configuration options for full-text search.
func (FullTextSearchConfig) RawJSON ¶
func (r FullTextSearchConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (FullTextSearchConfig) ToParam ¶
func (r FullTextSearchConfig) ToParam() FullTextSearchConfigParam
ToParam converts this FullTextSearchConfig to a FullTextSearchConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with FullTextSearchConfigParam.Overrides()
func (*FullTextSearchConfig) UnmarshalJSON ¶
func (r *FullTextSearchConfig) UnmarshalJSON(data []byte) error
type FullTextSearchConfigParam ¶
type FullTextSearchConfigParam struct { // The `b` document length normalization parameter for BM25. Defaults to `0.75`. B param.Opt[float64] `json:"b,omitzero"` // Whether searching is case-sensitive. Defaults to `false` (i.e. // case-insensitive). CaseSensitive param.Opt[bool] `json:"case_sensitive,omitzero"` // The `k1` term saturation parameter for BM25. Defaults to `1.2`. K1 param.Opt[float64] `json:"k1,omitzero"` // Removes common words from the text based on language. Defaults to `true` (i.e. // remove common words). RemoveStopwords param.Opt[bool] `json:"remove_stopwords,omitzero"` // Language-specific stemming for the text. Defaults to `false` (i.e., do not // stem). Stemming param.Opt[bool] `json:"stemming,omitzero"` // Describes the language of a text attribute. Defaults to `english`. // // Any of "arabic", "danish", "dutch", "english", "finnish", "french", "german", // "greek", "hungarian", "italian", "norwegian", "portuguese", "romanian", // "russian", "spanish", "swedish", "tamil", "turkish". Language Language `json:"language,omitzero"` // Maximum length of a token in bytes. Tokens larger than this value during // tokenization will be filtered out. Has to be between `1` and `254` (inclusive). // Defaults to `39`. MaxTokenLength param.Opt[int64] `json:"max_token_length,omitzero"` // The tokenizer to use for full-text search on an attribute. Defaults to // `word_v2`. // // Any of "pre_tokenized_array", "word_v0", "word_v1", "word_v2". Tokenizer Tokenizer `json:"tokenizer,omitzero"` // contains filtered or unexported fields }
Configuration options for full-text search.
func (FullTextSearchConfigParam) MarshalJSON ¶
func (r FullTextSearchConfigParam) MarshalJSON() (data []byte, err error)
func (*FullTextSearchConfigParam) UnmarshalJSON ¶
func (r *FullTextSearchConfigParam) UnmarshalJSON(data []byte) error
type ID ¶
type ID struct { // This field will be present if the value is a [string] instead of an object. String string `json:",inline"` // This field will be present if the value is a [int64] instead of an object. Int int64 `json:",inline"` JSON struct { String respjson.Field Int respjson.Field // contains filtered or unexported fields } `json:"-"` }
ID contains all possible properties and values from [string], [int64].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: String Int]
func (ID) ToParam ¶
ToParam converts this ID to a IDParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with IDParam.Overrides()
func (*ID) UnmarshalJSON ¶
type IDParam ¶
type IDParam struct { String param.Opt[string] `json:",omitzero,inline"` Int param.Opt[int64] `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (IDParam) MarshalJSON ¶
func (*IDParam) UnmarshalJSON ¶
type IncludeAttributesParam ¶
type IncludeAttributesParam struct { Bool param.Opt[bool] `json:",omitzero,inline"` StringArray []string `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (IncludeAttributesParam) MarshalJSON ¶
func (u IncludeAttributesParam) MarshalJSON() ([]byte, error)
func (*IncludeAttributesParam) UnmarshalJSON ¶
func (u *IncludeAttributesParam) UnmarshalJSON(data []byte) error
type Language ¶
type Language string
Describes the language of a text attribute. Defaults to `english`.
const ( LanguageArabic Language = "arabic" LanguageDanish Language = "danish" LanguageDutch Language = "dutch" LanguageEnglish Language = "english" LanguageFinnish Language = "finnish" LanguageFrench Language = "french" LanguageGerman Language = "german" LanguageGreek Language = "greek" LanguageHungarian Language = "hungarian" LanguageItalian Language = "italian" LanguageNorwegian Language = "norwegian" LanguagePortuguese Language = "portuguese" LanguageRomanian Language = "romanian" LanguageRussian Language = "russian" LanguageSpanish Language = "spanish" LanguageSwedish Language = "swedish" LanguageTamil Language = "tamil" LanguageTurkish Language = "turkish" )
type NamespaceDeleteAllResponse ¶
type NamespaceDeleteAllResponse struct { // The status of the request. Status constant.Ok `json:"status,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response to a successful namespace deletion request.
func (NamespaceDeleteAllResponse) RawJSON ¶
func (r NamespaceDeleteAllResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceDeleteAllResponse) UnmarshalJSON ¶
func (r *NamespaceDeleteAllResponse) UnmarshalJSON(data []byte) error
type NamespaceExplainQueryParams ¶ added in v0.1.14
type NamespaceExplainQueryParams struct { Namespace param.Opt[string] `path:"namespace,omitzero,required" json:"-"` // The number of results to return. TopK param.Opt[int64] `json:"top_k,omitzero"` // Aggregations to compute over all documents in the namespace that match the // filters. AggregateBy map[string]AggregateBy `json:"aggregate_by,omitzero"` // The consistency level for a query. Consistency NamespaceExplainQueryParamsConsistency `json:"consistency,omitzero"` // A function used to calculate vector similarity. // // Any of "cosine_distance", "euclidean_squared". DistanceMetric DistanceMetric `json:"distance_metric,omitzero"` // List of attribute names to exclude from the response. All other attributes will // be included in the response. ExcludeAttributes []string `json:"exclude_attributes,omitzero"` // Exact filters for attributes to refine search results for. Think of it as a SQL // WHERE clause. Filters Filter `json:"filters,omitzero"` // Groups documents by the specified attributes (the "group key") before computing // aggregates. Aggregates are computed separately for each group. GroupBy []string `json:"group_by,omitzero"` // Whether to include attributes in the response. IncludeAttributes IncludeAttributesParam `json:"include_attributes,omitzero"` // How to rank the documents in the namespace. RankBy RankBy `json:"rank_by,omitzero"` // The encoding to use for vectors in the response. // // Any of "float", "base64". VectorEncoding VectorEncoding `json:"vector_encoding,omitzero"` // contains filtered or unexported fields }
func (NamespaceExplainQueryParams) MarshalJSON ¶ added in v0.1.14
func (r NamespaceExplainQueryParams) MarshalJSON() (data []byte, err error)
func (*NamespaceExplainQueryParams) UnmarshalJSON ¶ added in v0.1.14
func (r *NamespaceExplainQueryParams) UnmarshalJSON(data []byte) error
type NamespaceExplainQueryParamsConsistency ¶ added in v0.1.14
type NamespaceExplainQueryParamsConsistency struct { // The query's consistency level. // // Any of "strong", "eventual". Level NamespaceExplainQueryParamsConsistencyLevel `json:"level,omitzero"` // contains filtered or unexported fields }
The consistency level for a query.
func (NamespaceExplainQueryParamsConsistency) MarshalJSON ¶ added in v0.1.14
func (r NamespaceExplainQueryParamsConsistency) MarshalJSON() (data []byte, err error)
func (*NamespaceExplainQueryParamsConsistency) UnmarshalJSON ¶ added in v0.1.14
func (r *NamespaceExplainQueryParamsConsistency) UnmarshalJSON(data []byte) error
type NamespaceExplainQueryParamsConsistencyLevel ¶ added in v0.1.14
type NamespaceExplainQueryParamsConsistencyLevel string
The query's consistency level.
const ( NamespaceExplainQueryParamsConsistencyLevelStrong NamespaceExplainQueryParamsConsistencyLevel = "strong" NamespaceExplainQueryParamsConsistencyLevelEventual NamespaceExplainQueryParamsConsistencyLevel = "eventual" )
type NamespaceExplainQueryResponse ¶ added in v0.1.14
type NamespaceExplainQueryResponse struct { // The textual representation of the query plan. PlanText string `json:"plan_text"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { PlanText respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response to a successful query explain.
func (NamespaceExplainQueryResponse) RawJSON ¶ added in v0.1.14
func (r NamespaceExplainQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceExplainQueryResponse) UnmarshalJSON ¶ added in v0.1.14
func (r *NamespaceExplainQueryResponse) UnmarshalJSON(data []byte) error
type NamespaceHintCacheWarmResponse ¶
type NamespaceHintCacheWarmResponse struct { // The status of the request. Status constant.Accepted `json:"status,required"` Message string `json:"message"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Status respjson.Field Message respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response to a successful cache warm request.
func (NamespaceHintCacheWarmResponse) RawJSON ¶
func (r NamespaceHintCacheWarmResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceHintCacheWarmResponse) UnmarshalJSON ¶
func (r *NamespaceHintCacheWarmResponse) UnmarshalJSON(data []byte) error
type NamespaceMetadata ¶ added in v0.1.7
type NamespaceMetadata struct { // The approximate number of logical bytes in the namespace. ApproxLogicalBytes int64 `json:"approx_logical_bytes,required"` // The approximate number of rows in the namespace. ApproxRowCount int64 `json:"approx_row_count,required"` // The timestamp when the namespace was created. CreatedAt time.Time `json:"created_at,required" format:"date-time"` // The schema of the namespace. Schema map[string]AttributeSchemaConfig `json:"schema,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ApproxLogicalBytes respjson.Field ApproxRowCount respjson.Field CreatedAt respjson.Field Schema respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Metadata about a namespace.
func (NamespaceMetadata) RawJSON ¶ added in v0.1.7
func (r NamespaceMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMetadata) UnmarshalJSON ¶ added in v0.1.7
func (r *NamespaceMetadata) UnmarshalJSON(data []byte) error
type NamespaceMetadataParams ¶ added in v0.1.7
type NamespaceMultiQueryParams ¶ added in v0.1.1
type NamespaceMultiQueryParams struct { Namespace param.Opt[string] `path:"namespace,omitzero,required" json:"-"` Queries []QueryParam `json:"queries,omitzero,required"` // The consistency level for a query. Consistency NamespaceMultiQueryParamsConsistency `json:"consistency,omitzero"` // The encoding to use for vectors in the response. // // Any of "float", "base64". VectorEncoding VectorEncoding `json:"vector_encoding,omitzero"` // contains filtered or unexported fields }
func (NamespaceMultiQueryParams) MarshalJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryParams) MarshalJSON() (data []byte, err error)
func (*NamespaceMultiQueryParams) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryParams) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryParamsConsistency ¶ added in v0.1.1
type NamespaceMultiQueryParamsConsistency struct { // The query's consistency level. // // Any of "strong", "eventual". Level NamespaceMultiQueryParamsConsistencyLevel `json:"level,omitzero"` // contains filtered or unexported fields }
The consistency level for a query.
func (NamespaceMultiQueryParamsConsistency) MarshalJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryParamsConsistency) MarshalJSON() (data []byte, err error)
func (*NamespaceMultiQueryParamsConsistency) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryParamsConsistency) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryParamsConsistencyLevel ¶ added in v0.1.1
type NamespaceMultiQueryParamsConsistencyLevel string
The query's consistency level.
const ( NamespaceMultiQueryParamsConsistencyLevelStrong NamespaceMultiQueryParamsConsistencyLevel = "strong" NamespaceMultiQueryParamsConsistencyLevelEventual NamespaceMultiQueryParamsConsistencyLevel = "eventual" )
type NamespaceMultiQueryResponse ¶ added in v0.1.1
type NamespaceMultiQueryResponse struct { // The billing information for a query. Billing QueryBilling `json:"billing,required"` // The performance information for a query. Performance QueryPerformance `json:"performance,required"` Results []NamespaceMultiQueryResponseResult `json:"results,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Billing respjson.Field Performance respjson.Field Results respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The result of a multi-query.
func (NamespaceMultiQueryResponse) RawJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMultiQueryResponse) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryResponse) UnmarshalJSON(data []byte) error
type NamespaceMultiQueryResponseResult ¶ added in v0.1.1
type NamespaceMultiQueryResponseResult struct { AggregationGroups []AggregationGroup `json:"aggregation_groups"` Aggregations map[string]any `json:"aggregations"` Rows []Row `json:"rows"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { AggregationGroups respjson.Field Aggregations respjson.Field Rows respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (NamespaceMultiQueryResponseResult) RawJSON ¶ added in v0.1.1
func (r NamespaceMultiQueryResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceMultiQueryResponseResult) UnmarshalJSON ¶ added in v0.1.1
func (r *NamespaceMultiQueryResponseResult) UnmarshalJSON(data []byte) error
type NamespaceQueryParams ¶
type NamespaceQueryParams struct { Namespace param.Opt[string] `path:"namespace,omitzero,required" json:"-"` // The number of results to return. TopK param.Opt[int64] `json:"top_k,omitzero"` // Aggregations to compute over all documents in the namespace that match the // filters. AggregateBy map[string]AggregateBy `json:"aggregate_by,omitzero"` // The consistency level for a query. Consistency NamespaceQueryParamsConsistency `json:"consistency,omitzero"` // A function used to calculate vector similarity. // // Any of "cosine_distance", "euclidean_squared". DistanceMetric DistanceMetric `json:"distance_metric,omitzero"` // List of attribute names to exclude from the response. All other attributes will // be included in the response. ExcludeAttributes []string `json:"exclude_attributes,omitzero"` // Exact filters for attributes to refine search results for. Think of it as a SQL // WHERE clause. Filters Filter `json:"filters,omitzero"` // Groups documents by the specified attributes (the "group key") before computing // aggregates. Aggregates are computed separately for each group. GroupBy []string `json:"group_by,omitzero"` // Whether to include attributes in the response. IncludeAttributes IncludeAttributesParam `json:"include_attributes,omitzero"` // How to rank the documents in the namespace. RankBy RankBy `json:"rank_by,omitzero"` // The encoding to use for vectors in the response. // // Any of "float", "base64". VectorEncoding VectorEncoding `json:"vector_encoding,omitzero"` // contains filtered or unexported fields }
func (NamespaceQueryParams) MarshalJSON ¶
func (r NamespaceQueryParams) MarshalJSON() (data []byte, err error)
func (*NamespaceQueryParams) UnmarshalJSON ¶
func (r *NamespaceQueryParams) UnmarshalJSON(data []byte) error
type NamespaceQueryParamsConsistency ¶
type NamespaceQueryParamsConsistency struct { // The query's consistency level. // // Any of "strong", "eventual". Level NamespaceQueryParamsConsistencyLevel `json:"level,omitzero"` // contains filtered or unexported fields }
The consistency level for a query.
func (NamespaceQueryParamsConsistency) MarshalJSON ¶
func (r NamespaceQueryParamsConsistency) MarshalJSON() (data []byte, err error)
func (*NamespaceQueryParamsConsistency) UnmarshalJSON ¶
func (r *NamespaceQueryParamsConsistency) UnmarshalJSON(data []byte) error
type NamespaceQueryParamsConsistencyLevel ¶
type NamespaceQueryParamsConsistencyLevel string
The query's consistency level.
const ( NamespaceQueryParamsConsistencyLevelStrong NamespaceQueryParamsConsistencyLevel = "strong" NamespaceQueryParamsConsistencyLevelEventual NamespaceQueryParamsConsistencyLevel = "eventual" )
type NamespaceQueryResponse ¶
type NamespaceQueryResponse struct { // The billing information for a query. Billing QueryBilling `json:"billing,required"` // The performance information for a query. Performance QueryPerformance `json:"performance,required"` AggregationGroups []AggregationGroup `json:"aggregation_groups"` Aggregations map[string]any `json:"aggregations"` Rows []Row `json:"rows"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Billing respjson.Field Performance respjson.Field AggregationGroups respjson.Field Aggregations respjson.Field Rows respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The result of a query.
func (NamespaceQueryResponse) RawJSON ¶
func (r NamespaceQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceQueryResponse) UnmarshalJSON ¶
func (r *NamespaceQueryResponse) UnmarshalJSON(data []byte) error
type NamespaceRecallParams ¶
type NamespaceRecallParams struct { Namespace param.Opt[string] `path:"namespace,omitzero,required" json:"-"` // Include ground truth data (query vectors and true nearest neighbors) in the // response. IncludeGroundTruth param.Opt[bool] `json:"include_ground_truth,omitzero"` // The number of searches to run. Num param.Opt[int64] `json:"num,omitzero"` // Search for `top_k` nearest neighbors. TopK param.Opt[int64] `json:"top_k,omitzero"` // Filter by attributes. Same syntax as the query endpoint. Filters any `json:"filters,omitzero"` // Use specific query vectors for the measurement. If omitted, sampled from the // index. Queries []float32 `json:"queries,omitzero"` // contains filtered or unexported fields }
func (NamespaceRecallParams) MarshalJSON ¶
func (r NamespaceRecallParams) MarshalJSON() (data []byte, err error)
func (*NamespaceRecallParams) UnmarshalJSON ¶
func (r *NamespaceRecallParams) UnmarshalJSON(data []byte) error
type NamespaceRecallResponse ¶
type NamespaceRecallResponse struct { // The average number of documents retrieved by the approximate nearest neighbor // searches. AvgAnnCount float64 `json:"avg_ann_count,required"` // The average number of documents retrieved by the exhaustive searches. AvgExhaustiveCount float64 `json:"avg_exhaustive_count,required"` // The average recall of the queries. AvgRecall float64 `json:"avg_recall,required"` // Ground truth data including query vectors and true nearest neighbors. Only // included when include_ground_truth is true. GroundTruth []NamespaceRecallResponseGroundTruth `json:"ground_truth"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { AvgAnnCount respjson.Field AvgExhaustiveCount respjson.Field AvgRecall respjson.Field GroundTruth respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response to a successful cache warm request.
func (NamespaceRecallResponse) RawJSON ¶
func (r NamespaceRecallResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceRecallResponse) UnmarshalJSON ¶
func (r *NamespaceRecallResponse) UnmarshalJSON(data []byte) error
type NamespaceRecallResponseGroundTruth ¶ added in v1.2.0
type NamespaceRecallResponseGroundTruth struct { // The true nearest neighbors with their distances and vectors. NearestNeighbors []Row `json:"nearest_neighbors,required"` // The query vector used for this search. QueryVector []float64 `json:"query_vector,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { NearestNeighbors respjson.Field QueryVector respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (NamespaceRecallResponseGroundTruth) RawJSON ¶ added in v1.2.0
func (r NamespaceRecallResponseGroundTruth) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceRecallResponseGroundTruth) UnmarshalJSON ¶ added in v1.2.0
func (r *NamespaceRecallResponseGroundTruth) UnmarshalJSON(data []byte) error
type NamespaceSchemaParams ¶
type NamespaceSchemaResponse ¶
type NamespaceSchemaResponse map[string]AttributeSchemaConfig
type NamespaceService ¶
type NamespaceService struct {
Options []option.RequestOption
}
NamespaceService contains methods and other services that help with interacting with the turbopuffer API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the [NewNamespaceService] method instead.
func (*NamespaceService) DeleteAll ¶
func (r *NamespaceService) DeleteAll(ctx context.Context, body NamespaceDeleteAllParams, opts ...option.RequestOption) (res *NamespaceDeleteAllResponse, err error)
Delete namespace.
func (*NamespaceService) ExplainQuery ¶ added in v0.1.14
func (r *NamespaceService) ExplainQuery(ctx context.Context, params NamespaceExplainQueryParams, opts ...option.RequestOption) (res *NamespaceExplainQueryResponse, err error)
Explain a query plan.
func (*NamespaceService) HintCacheWarm ¶
func (r *NamespaceService) HintCacheWarm(ctx context.Context, query NamespaceHintCacheWarmParams, opts ...option.RequestOption) (res *NamespaceHintCacheWarmResponse, err error)
Warm the cache for a namespace.
func (*NamespaceService) ID ¶
func (r *NamespaceService) ID() string
func (*NamespaceService) Metadata ¶ added in v0.1.7
func (r *NamespaceService) Metadata(ctx context.Context, query NamespaceMetadataParams, opts ...option.RequestOption) (res *NamespaceMetadata, err error)
Get metadata about a namespace.
func (*NamespaceService) MultiQuery ¶ added in v0.1.1
func (r *NamespaceService) MultiQuery(ctx context.Context, params NamespaceMultiQueryParams, opts ...option.RequestOption) (res *NamespaceMultiQueryResponse, err error)
Issue multiple concurrent queries filter or search documents.
func (*NamespaceService) Query ¶
func (r *NamespaceService) Query(ctx context.Context, params NamespaceQueryParams, opts ...option.RequestOption) (res *NamespaceQueryResponse, err error)
Query, filter, full-text search and vector search documents.
func (*NamespaceService) Recall ¶
func (r *NamespaceService) Recall(ctx context.Context, params NamespaceRecallParams, opts ...option.RequestOption) (res *NamespaceRecallResponse, err error)
Evaluate recall.
func (*NamespaceService) Schema ¶
func (r *NamespaceService) Schema(ctx context.Context, query NamespaceSchemaParams, opts ...option.RequestOption) (res *NamespaceSchemaResponse, err error)
Get namespace schema.
func (*NamespaceService) UpdateSchema ¶
func (r *NamespaceService) UpdateSchema(ctx context.Context, params NamespaceUpdateSchemaParams, opts ...option.RequestOption) (res *NamespaceUpdateSchemaResponse, err error)
Update namespace schema.
func (*NamespaceService) Write ¶
func (r *NamespaceService) Write(ctx context.Context, params NamespaceWriteParams, opts ...option.RequestOption) (res *NamespaceWriteResponse, err error)
Create, update, or delete documents.
type NamespaceSummary ¶
type NamespaceSummary struct { // The namespace ID. ID string `json:"id,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A summary of a namespace.
func (NamespaceSummary) RawJSON ¶
func (r NamespaceSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceSummary) UnmarshalJSON ¶
func (r *NamespaceSummary) UnmarshalJSON(data []byte) error
type NamespaceUpdateSchemaParams ¶
type NamespaceUpdateSchemaParams struct { Namespace param.Opt[string] `path:"namespace,omitzero,required" json:"-"` // The desired schema for the namespace. Schema map[string]AttributeSchemaConfigParam // contains filtered or unexported fields }
func (NamespaceUpdateSchemaParams) MarshalJSON ¶
func (r NamespaceUpdateSchemaParams) MarshalJSON() (data []byte, err error)
func (*NamespaceUpdateSchemaParams) UnmarshalJSON ¶
func (r *NamespaceUpdateSchemaParams) UnmarshalJSON(data []byte) error
type NamespaceUpdateSchemaResponse ¶
type NamespaceUpdateSchemaResponse map[string]AttributeSchemaConfig
type NamespaceWriteParams ¶
type NamespaceWriteParams struct { Namespace param.Opt[string] `path:"namespace,omitzero,required" json:"-"` // The namespace to copy documents from. CopyFromNamespace param.Opt[string] `json:"copy_from_namespace,omitzero"` // The filter specifying which documents to delete. DeleteByFilter Filter `json:"delete_by_filter,omitzero"` // A condition evaluated against the current value of each document targeted by a // delete write. Only documents that pass the condition are deleted. DeleteCondition Filter `json:"delete_condition,omitzero"` Deletes []any `json:"deletes,omitzero"` // A function used to calculate vector similarity. // // Any of "cosine_distance", "euclidean_squared". DistanceMetric DistanceMetric `json:"distance_metric,omitzero"` // The encryption configuration for a namespace. Encryption NamespaceWriteParamsEncryption `json:"encryption,omitzero"` // A list of documents in columnar format. Each key is a column name, mapped to an // array of values for that column. PatchColumns ColumnsParam `json:"patch_columns,omitzero"` // A condition evaluated against the current value of each document targeted by a // patch write. Only documents that pass the condition are patched. PatchCondition Filter `json:"patch_condition,omitzero"` PatchRows []RowParam `json:"patch_rows,omitzero"` // The schema of the attributes attached to the documents. Schema map[string]AttributeSchemaConfigParam `json:"schema,omitzero"` // A list of documents in columnar format. Each key is a column name, mapped to an // array of values for that column. UpsertColumns ColumnsParam `json:"upsert_columns,omitzero"` // A condition evaluated against the current value of each document targeted by an // upsert write. Only documents that pass the condition are upserted. UpsertCondition Filter `json:"upsert_condition,omitzero"` UpsertRows []RowParam `json:"upsert_rows,omitzero"` // contains filtered or unexported fields }
func (NamespaceWriteParams) MarshalJSON ¶
func (r NamespaceWriteParams) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParams) UnmarshalJSON ¶
func (r *NamespaceWriteParams) UnmarshalJSON(data []byte) error
type NamespaceWriteParamsEncryption ¶
type NamespaceWriteParamsEncryption struct { Cmek NamespaceWriteParamsEncryptionCmek `json:"cmek,omitzero"` // contains filtered or unexported fields }
The encryption configuration for a namespace.
func (NamespaceWriteParamsEncryption) MarshalJSON ¶
func (r NamespaceWriteParamsEncryption) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParamsEncryption) UnmarshalJSON ¶
func (r *NamespaceWriteParamsEncryption) UnmarshalJSON(data []byte) error
type NamespaceWriteParamsEncryptionCmek ¶
type NamespaceWriteParamsEncryptionCmek struct { // The identifier of the CMEK key to use for encryption. For GCP, the // fully-qualified resource name of the key. For AWS, the ARN of the key. KeyName string `json:"key_name,required"` // contains filtered or unexported fields }
The property KeyName is required.
func (NamespaceWriteParamsEncryptionCmek) MarshalJSON ¶
func (r NamespaceWriteParamsEncryptionCmek) MarshalJSON() (data []byte, err error)
func (*NamespaceWriteParamsEncryptionCmek) UnmarshalJSON ¶
func (r *NamespaceWriteParamsEncryptionCmek) UnmarshalJSON(data []byte) error
type NamespaceWriteResponse ¶
type NamespaceWriteResponse struct { // The billing information for a write request. Billing WriteBilling `json:"billing,required"` // A message describing the result of the write request. Message string `json:"message,required"` // The number of rows affected by the write request. RowsAffected int64 `json:"rows_affected,required"` // The status of the request. Status constant.Ok `json:"status,required"` // The number of rows deleted by the write request. RowsDeleted int64 `json:"rows_deleted"` // The number of rows patched by the write request. RowsPatched int64 `json:"rows_patched"` // The number of rows upserted by the write request. RowsUpserted int64 `json:"rows_upserted"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Billing respjson.Field Message respjson.Field RowsAffected respjson.Field Status respjson.Field RowsDeleted respjson.Field RowsPatched respjson.Field RowsUpserted respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response to a successful write request.
func (NamespaceWriteResponse) RawJSON ¶
func (r NamespaceWriteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NamespaceWriteResponse) UnmarshalJSON ¶
func (r *NamespaceWriteResponse) UnmarshalJSON(data []byte) error
type NamespacesParams ¶
type NamespacesParams struct { // Retrieve the next page of results. Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"` // Limit the number of results per page. PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"` // Retrieve only the namespaces that match the prefix. Prefix param.Opt[string] `query:"prefix,omitzero" json:"-"` // contains filtered or unexported fields }
func (NamespacesParams) URLQuery ¶
func (r NamespacesParams) URLQuery() (v url.Values, err error)
URLQuery serializes NamespacesParams's query parameters as `url.Values`.
type QueryBilling ¶
type QueryBilling struct { // The number of billable logical bytes queried from the namespace. BillableLogicalBytesQueried int64 `json:"billable_logical_bytes_queried,required"` // The number of billable logical bytes returned from the query. BillableLogicalBytesReturned int64 `json:"billable_logical_bytes_returned,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { BillableLogicalBytesQueried respjson.Field BillableLogicalBytesReturned respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The billing information for a query.
func (QueryBilling) RawJSON ¶
func (r QueryBilling) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryBilling) UnmarshalJSON ¶
func (r *QueryBilling) UnmarshalJSON(data []byte) error
type QueryParam ¶ added in v0.1.3
type QueryParam struct { // The number of results to return. TopK param.Opt[int64] `json:"top_k,omitzero"` // Aggregations to compute over all documents in the namespace that match the // filters. AggregateBy map[string]AggregateBy `json:"aggregate_by,omitzero"` // A function used to calculate vector similarity. // // Any of "cosine_distance", "euclidean_squared". DistanceMetric DistanceMetric `json:"distance_metric,omitzero"` // List of attribute names to exclude from the response. All other attributes will // be included in the response. ExcludeAttributes []string `json:"exclude_attributes,omitzero"` // Exact filters for attributes to refine search results for. Think of it as a SQL // WHERE clause. Filters Filter `json:"filters,omitzero"` // Groups documents by the specified attributes (the "group key") before computing // aggregates. Aggregates are computed separately for each group. GroupBy []string `json:"group_by,omitzero"` // Whether to include attributes in the response. IncludeAttributes IncludeAttributesParam `json:"include_attributes,omitzero"` // How to rank the documents in the namespace. RankBy RankBy `json:"rank_by,omitzero"` // contains filtered or unexported fields }
Query, filter, full-text search and vector search documents.
func (QueryParam) MarshalJSON ¶ added in v0.1.3
func (r QueryParam) MarshalJSON() (data []byte, err error)
func (*QueryParam) UnmarshalJSON ¶ added in v0.1.3
func (r *QueryParam) UnmarshalJSON(data []byte) error
type QueryPerformance ¶
type QueryPerformance struct { // the approximate number of documents in the namespace. ApproxNamespaceSize int64 `json:"approx_namespace_size,required"` // The ratio of cache hits to total cache lookups. CacheHitRatio float64 `json:"cache_hit_ratio,required"` // A qualitative description of the cache hit ratio (`hot`, `warm`, or `cold`). CacheTemperature string `json:"cache_temperature,required"` // The number of unindexed documents processed by the query. ExhaustiveSearchCount int64 `json:"exhaustive_search_count,required"` // Request time measured on the server, excluding time spent waiting due to the // namespace concurrency limit. QueryExecutionMs int64 `json:"query_execution_ms,required"` // Request time measured on the server, including time spent waiting for other // queries to complete if the namespace was at its concurrency limit. ServerTotalMs int64 `json:"server_total_ms,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ApproxNamespaceSize respjson.Field CacheHitRatio respjson.Field CacheTemperature respjson.Field ExhaustiveSearchCount respjson.Field QueryExecutionMs respjson.Field ServerTotalMs respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The performance information for a query.
func (QueryPerformance) RawJSON ¶
func (r QueryPerformance) RawJSON() string
Returns the unmodified JSON received from the API
func (*QueryPerformance) UnmarshalJSON ¶
func (r *QueryPerformance) UnmarshalJSON(data []byte) error
type RankByAttribute ¶
type RankByAttribute struct {
// contains filtered or unexported fields
}
func NewRankByAttribute ¶
func NewRankByAttribute( attr string, order RankByAttributeOrder, ) RankByAttribute
func (RankByAttribute) MarshalJSON ¶
func (v RankByAttribute) MarshalJSON() ([]byte, error)
type RankByAttributeOrder ¶
type RankByAttributeOrder string
const ( RankByAttributeOrderAsc RankByAttributeOrder = "asc" RankByAttributeOrderDesc RankByAttributeOrder = "desc" )
type RankByText ¶
type RankByText interface {
// contains filtered or unexported methods
}
type RankByTextBM25 ¶
type RankByTextBM25 struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25 ¶
func NewRankByTextBM25( attr string, value string, ) RankByTextBM25
func (RankByTextBM25) MarshalJSON ¶
func (v RankByTextBM25) MarshalJSON() ([]byte, error)
type RankByTextBM25Array ¶
type RankByTextBM25Array struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25Array ¶
func NewRankByTextBM25Array( attr string, value []string, ) RankByTextBM25Array
func (RankByTextBM25Array) MarshalJSON ¶
func (v RankByTextBM25Array) MarshalJSON() ([]byte, error)
type RankByTextBM25ArrayWithParams ¶ added in v1.2.0
type RankByTextBM25ArrayWithParams struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25ArrayWithParams ¶ added in v1.2.0
func NewRankByTextBM25ArrayWithParams( attr string, value []string, params Bm25ClauseParams, ) RankByTextBM25ArrayWithParams
func (RankByTextBM25ArrayWithParams) MarshalJSON ¶ added in v1.2.0
func (v RankByTextBM25ArrayWithParams) MarshalJSON() ([]byte, error)
type RankByTextBM25WithParams ¶ added in v1.2.0
type RankByTextBM25WithParams struct {
// contains filtered or unexported fields
}
func NewRankByTextBM25WithParams ¶ added in v1.2.0
func NewRankByTextBM25WithParams( attr string, value string, params Bm25ClauseParams, ) RankByTextBM25WithParams
func (RankByTextBM25WithParams) MarshalJSON ¶ added in v1.2.0
func (v RankByTextBM25WithParams) MarshalJSON() ([]byte, error)
type RankByTextMax ¶
type RankByTextMax struct {
// contains filtered or unexported fields
}
func NewRankByTextMax ¶
func NewRankByTextMax( subqueries []RankByText, ) RankByTextMax
func (RankByTextMax) MarshalJSON ¶
func (v RankByTextMax) MarshalJSON() ([]byte, error)
type RankByTextProduct ¶
type RankByTextProduct struct {
// contains filtered or unexported fields
}
func NewRankByTextProduct ¶
func NewRankByTextProduct( weight float64, subquery RankByText, ) RankByTextProduct
func (RankByTextProduct) MarshalJSON ¶
func (v RankByTextProduct) MarshalJSON() ([]byte, error)
type RankByTextSum ¶
type RankByTextSum struct {
// contains filtered or unexported fields
}
func NewRankByTextSum ¶
func NewRankByTextSum( subqueries []RankByText, ) RankByTextSum
func (RankByTextSum) MarshalJSON ¶
func (v RankByTextSum) MarshalJSON() ([]byte, error)
type RankByVector ¶
type RankByVector struct {
// contains filtered or unexported fields
}
func NewRankByVector ¶
func NewRankByVector( attr string, value []float32, ) RankByVector
func (RankByVector) MarshalJSON ¶
func (v RankByVector) MarshalJSON() ([]byte, error)
type Tokenizer ¶
type Tokenizer string
The tokenizer to use for full-text search on an attribute. Defaults to `word_v2`.
type Vector ¶
type Vector struct { // This field will be present if the value is a [[]float32] instead of an object. FloatArray []float32 `json:",inline"` // This field will be present if the value is a [string] instead of an object. String string `json:",inline"` JSON struct { FloatArray respjson.Field String respjson.Field // contains filtered or unexported fields } `json:"-"` }
Vector contains all possible properties and values from [[]float32], [string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: FloatArray String]
func (Vector) AsFloatArray ¶
func (Vector) ToParam ¶
func (r Vector) ToParam() VectorParam
ToParam converts this Vector to a VectorParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with VectorParam.Overrides()
func (*Vector) UnmarshalJSON ¶
type VectorEncoding ¶
type VectorEncoding string
The encoding to use for vectors in the response.
const ( VectorEncodingFloat VectorEncoding = "float" VectorEncodingBase64 VectorEncoding = "base64" )
type VectorParam ¶
type VectorParam struct { FloatArray []float32 `json:",omitzero,inline"` String param.Opt[string] `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (VectorParam) MarshalJSON ¶
func (u VectorParam) MarshalJSON() ([]byte, error)
func (*VectorParam) UnmarshalJSON ¶
func (u *VectorParam) UnmarshalJSON(data []byte) error
type WriteBilling ¶
type WriteBilling struct { // The number of billable logical bytes written to the namespace. BillableLogicalBytesWritten int64 `json:"billable_logical_bytes_written,required"` // The billing information for a query. Query QueryBilling `json:"query"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { BillableLogicalBytesWritten respjson.Field Query respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The billing information for a write request.
func (WriteBilling) RawJSON ¶
func (r WriteBilling) RawJSON() string
Returns the unmodified JSON received from the API
func (*WriteBilling) UnmarshalJSON ¶
func (r *WriteBilling) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
bulk_write
command
|
|
list_namespaces
command
|
|
write_and_query
command
|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
packages
|
|
shared
|
|