pub struct Schema { /* private fields */ }Expand description
Schema defining document structure
Implementations§
Source§impl Schema
impl Schema
pub fn builder() -> SchemaBuilder
pub fn get_field(&self, name: &str) -> Option<Field>
pub fn get_field_entry(&self, field: Field) -> Option<&FieldEntry>
Sourcepub fn tokenizer_hint_field(&self, field: Field) -> Option<Field>
pub fn tokenizer_hint_field(&self, field: Field) -> Option<Field>
Field whose values hint the dynamic tokenizer of field
(text<lex(by: <hint field>, ...)>), if any.
Sourcepub fn with_vector_index_alter(
&self,
field: Field,
alter: VectorIndexAlter,
) -> Result<Self, String>
pub fn with_vector_index_alter( &self, field: Field, alter: VectorIndexAlter, ) -> Result<Self, String>
Clone this schema with one vector field’s ANN parameters replaced. Field type, dimension, and storage quantization are immutable.
pub fn get_field_name(&self, field: Field) -> Option<&str>
pub fn fields(&self) -> impl Iterator<Item = (Field, &FieldEntry)>
pub fn num_fields(&self) -> usize
Sourcepub fn has_reorder_fields(&self) -> bool
pub fn has_reorder_fields(&self) -> bool
Whether any field has the reorder attribute set.
Used by the background optimizer to determine which indexes need BP reordering.
Sourcepub fn reorder_on_merge(&self) -> bool
pub fn reorder_on_merge(&self) -> bool
Whether merges BP-reorder reorder-attributed BMP fields while writing
the merged segment (index-level SDL option reorder_on_merge: true).
Sourcepub fn index_label(&self) -> &str
pub fn index_label(&self) -> &str
Index name for metric labels (“unknown” when not set — pre-existing metadata or programmatic schemas without a name).
Sourcepub fn set_index_name(&mut self, name: impl Into<String>)
pub fn set_index_name(&mut self, name: impl Into<String>)
Set the index name used as the metrics index label.
Sourcepub fn default_fields(&self) -> &[Field]
pub fn default_fields(&self) -> &[Field]
Get the default fields for query parsing
Sourcepub fn set_default_fields(&mut self, fields: Vec<Field>)
pub fn set_default_fields(&mut self, fields: Vec<Field>)
Set default fields (used by builder)
Sourcepub fn query_routers(&self) -> &[QueryRouterRule]
pub fn query_routers(&self) -> &[QueryRouterRule]
Get the query router rules
Sourcepub fn set_query_routers(&mut self, rules: Vec<QueryRouterRule>)
pub fn set_query_routers(&mut self, rules: Vec<QueryRouterRule>)
Set query router rules
Sourcepub fn primary_field(&self) -> Option<Field>
pub fn primary_field(&self) -> Option<Field>
Get the primary key field, if one is defined
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
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>,
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> ⓘ
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> ⓘ
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 more