Documentation
¶
Index ¶
- func Clone(item *retrieval.Result) *retrieval.Result
- func IsJSONNumber(value any) bool
- func MatchesFilter(item *retrieval.Result, filter map[string]any) bool
- func Search(ctx context.Context, query indexcontract.IndexQuery, items []*retrieval.Result) ([]*retrieval.Result, error)
- func ValidateDocumentID(documentID string) error
- func ValidateFilter(filter map[string]any) error
- func ValidateReplacements(replacements []indexcontract.DocumentReplacement) error
- type Space
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
Clone returns a result whose embedding and canonical JSON metadata containers do not alias stored state. Nested map[string]any objects and []any arrays are cloned recursively. Typed containers such as map[string]string retain their original value semantics and are outside this isolation guarantee.
func IsJSONNumber ¶ added in v0.9.0
IsJSONNumber reports whether value is one of the accepted numeric filter types. It assumes ValidateFilter has already accepted the value.
func MatchesFilter ¶ added in v0.9.0
MatchesFilter reports whether item matches every filter entry. Callers must validate the filter first with ValidateFilter.
func Search ¶
func Search(ctx context.Context, query indexcontract.IndexQuery, items []*retrieval.Result) ([]*retrieval.Result, error)
Search copies, filters, scores, and limits an in-memory candidate set.
func ValidateDocumentID ¶ added in v0.9.0
ValidateDocumentID rejects empty or whitespace-only document identifiers.
func ValidateFilter ¶ added in v0.9.0
ValidateFilter enforces the backend-independent JSON-scalar filter contract.
func ValidateReplacements ¶ added in v0.9.0
func ValidateReplacements(replacements []indexcontract.DocumentReplacement) error
ValidateReplacements enforces the document-replacement batch invariants shared by every built-in Index implementation.
Types ¶
type Space ¶ added in v0.9.0
Space is the reset-only identity and embedding-dimension latch shared by Index implementations. IdentitySet distinguishes an unestablished identity from an established empty identity.
func (Space) ValidateQuery ¶ added in v0.9.0
func (s Space) ValidateQuery(query indexcontract.IndexQuery) error
ValidateQuery rejects reads against a different established index space.
func (Space) ValidateResults ¶ added in v0.9.0
ValidateResults returns the space produced by accepting items. The receiver is unchanged when validation fails. The first non-nil result establishes the identity, and the first result with an embedding establishes the dimension.