pub struct InternalSchema {
pub defaults: ValueTypes,
pub keys: HashMap<String, ValueTypes>,
}Expand description
Internal schema representation for collection index configurations This represents the server-side schema structure used for index management
Fields§
§defaults: ValueTypesDefault index configurations for each value type
keys: HashMap<String, ValueTypes>Key-specific index overrides TODO(Sanket): Needed for backwards compatibility. Should remove after deploy.
Implementations§
Source§impl InternalSchema
impl InternalSchema
Sourcepub fn new_default(default_knn_index: KnnIndex) -> Self
pub fn new_default(default_knn_index: KnnIndex) -> Self
Create a new InternalSchema with strongly-typed default configurations
pub fn get_internal_spann_config(&self) -> Option<InternalSpannConfiguration>
Sourcepub fn reconcile_with_defaults(
user_schema: Option<InternalSchema>,
) -> Result<Self, String>
pub fn reconcile_with_defaults( user_schema: Option<InternalSchema>, ) -> Result<Self, String>
Reconcile user-provided schema with system defaults
This method merges user configurations with system defaults, ensuring that:
- User overrides take precedence over defaults
- Missing user configurations fall back to system defaults
- Field-level merging for complex configurations (Vector, HNSW, SPANN, etc.)
Sourcepub fn merge(
&self,
other: &InternalSchema,
) -> Result<InternalSchema, SchemaError>
pub fn merge( &self, other: &InternalSchema, ) -> Result<InternalSchema, SchemaError>
Merge two schemas together, combining key overrides when possible.
Sourcepub fn reconcile_with_collection_config(
schema: InternalSchema,
collection_config: InternalCollectionConfiguration,
) -> Result<InternalSchema, String>
pub fn reconcile_with_collection_config( schema: InternalSchema, collection_config: InternalCollectionConfiguration, ) -> Result<InternalSchema, String>
Reconcile InternalSchema with InternalCollectionConfiguration
Simple reconciliation logic:
- If collection config is default → return schema (schema is source of truth)
- If collection config is non-default and schema is non-default → error (both set)
- If collection config is non-default and schema is default → override schema with collection config
pub fn reconcile_schema_and_config( schema: Option<InternalSchema>, configuration: Option<InternalCollectionConfiguration>, ) -> Result<InternalSchema, String>
Sourcepub fn is_metadata_type_index_enabled(
&self,
key: &str,
value_type: MetadataValueType,
) -> Result<bool, SchemaError>
pub fn is_metadata_type_index_enabled( &self, key: &str, value_type: MetadataValueType, ) -> Result<bool, SchemaError>
Check if a specific metadata key-value should be indexed based on schema configuration
pub fn is_metadata_where_indexing_enabled( &self, where_clause: &Where, ) -> Result<(), FilterValidationError>
pub fn is_knn_key_indexing_enabled( &self, key: &str, query: &QueryVector, ) -> Result<(), FilterValidationError>
pub fn ensure_key_from_metadata( &mut self, key: &str, value_type: MetadataValueType, ) -> bool
Trait Implementations§
Source§impl Clone for InternalSchema
impl Clone for InternalSchema
Source§fn clone(&self) -> InternalSchema
fn clone(&self) -> InternalSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InternalSchema
impl Debug for InternalSchema
Source§impl<'de> Deserialize<'de> for InternalSchema
impl<'de> Deserialize<'de> for InternalSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InternalSchema
impl PartialEq for InternalSchema
Source§impl Serialize for InternalSchema
impl Serialize for InternalSchema
impl StructuralPartialEq for InternalSchema
Auto Trait Implementations§
impl Freeze for InternalSchema
impl RefUnwindSafe for InternalSchema
impl Send for InternalSchema
impl Sync for InternalSchema
impl Unpin for InternalSchema
impl UnwindSafe for InternalSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.