Documentation
¶
Overview ¶
Package opensearch provides an OpenSearch type provider for CEL type system integration.
An OpenSearch index mapping is loaded with GET /<index>/_mapping and turned into a schema: scalar field types map to CEL scalars, object fields become nested schemas addressed by dot path (p.dims.width) and nested fields become lists of nested schemas that CEL comprehensions iterate (p.variants.exists(v, v.sku == "A")).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidSchema indicates a problem with the provided schema or index introspection. ErrInvalidSchema = errors.New("invalid schema") )
Sentinel errors for the opensearch package.
var NewSchema = schema.NewSchema
NewSchema creates a new Schema. This is an alias for schema.NewSchema.
Functions ¶
This section is empty.
Types ¶
type FieldSchema ¶
type FieldSchema = schema.FieldSchema
FieldSchema is an alias for schema.FieldSchema.
type TypeProvider ¶
type TypeProvider interface {
types.Provider
LoadTableSchema(ctx context.Context, indexName string) error
GetSchemas() map[string]Schema
Close()
}
TypeProvider is the OpenSearch type provider interface.
func NewTypeProvider ¶
func NewTypeProvider(schemas map[string]Schema) TypeProvider
NewTypeProvider creates a new OpenSearch type provider with pre-defined schemas.
func NewTypeProviderWithClient ¶
func NewTypeProviderWithClient(_ context.Context, client *opensearchapi.Client) (TypeProvider, error)
NewTypeProviderWithClient creates a new OpenSearch type provider that can introspect index mappings. The caller owns the *opensearchapi.Client and is responsible for its lifetime; Close is a no-op.