pub struct SchemaBuilder { /* private fields */ }Expand description
Builder for Schema
Implementations§
Source§impl SchemaBuilder
impl SchemaBuilder
pub fn add_text_field( &mut self, name: &str, indexed: bool, stored: bool, ) -> Field
pub fn add_text_field_with_tokenizer( &mut self, name: &str, indexed: bool, stored: bool, tokenizer: &str, ) -> Field
pub fn add_u64_field( &mut self, name: &str, indexed: bool, stored: bool, ) -> Field
pub fn add_i64_field( &mut self, name: &str, indexed: bool, stored: bool, ) -> Field
pub fn add_f64_field( &mut self, name: &str, indexed: bool, stored: bool, ) -> Field
pub fn add_bytes_field(&mut self, name: &str, stored: bool) -> Field
Sourcepub fn add_sparse_vector_field(
&mut self,
name: &str,
indexed: bool,
stored: bool,
) -> Field
pub fn add_sparse_vector_field( &mut self, name: &str, indexed: bool, stored: bool, ) -> Field
Add a sparse vector field with default configuration
Sparse vectors are indexed as inverted posting lists where each dimension becomes a “term” and documents have quantized weights for each dimension.
Sourcepub fn add_sparse_vector_field_with_config(
&mut self,
name: &str,
indexed: bool,
stored: bool,
config: SparseVectorConfig,
) -> Field
pub fn add_sparse_vector_field_with_config( &mut self, name: &str, indexed: bool, stored: bool, config: SparseVectorConfig, ) -> Field
Add a sparse vector field with custom configuration
Use SparseVectorConfig::splade() for SPLADE models (u16 indices, uint8 weights).
Use SparseVectorConfig::compact() for maximum compression (u16 indices, uint4 weights).
Sourcepub fn set_sparse_vector_config(
&mut self,
field: Field,
config: SparseVectorConfig,
)
pub fn set_sparse_vector_config( &mut self, field: Field, config: SparseVectorConfig, )
Set sparse vector configuration for an existing field
Sourcepub fn set_multi(&mut self, field: Field, multi: bool)
pub fn set_multi(&mut self, field: Field, multi: bool)
Set the multi attribute on the last added field
Sourcepub fn set_default_fields(&mut self, field_names: Vec<String>)
pub fn set_default_fields(&mut self, field_names: Vec<String>)
Set default fields by name
Sourcepub fn set_query_routers(&mut self, rules: Vec<QueryRouterRule>)
pub fn set_query_routers(&mut self, rules: Vec<QueryRouterRule>)
Set query router rules
pub fn build(self) -> Schema
Trait Implementations§
Source§impl Debug for SchemaBuilder
impl Debug for SchemaBuilder
Source§impl Default for SchemaBuilder
impl Default for SchemaBuilder
Source§fn default() -> SchemaBuilder
fn default() -> SchemaBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaBuilder
impl RefUnwindSafe for SchemaBuilder
impl Send for SchemaBuilder
impl Sync for SchemaBuilder
impl Unpin for SchemaBuilder
impl UnwindSafe for SchemaBuilder
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> 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 more