Skip to main content

Bm25TextConfig

Struct Bm25TextConfig 

Source
pub struct Bm25TextConfig {
    pub params: Bm25Params,
    pub tokenizer: Tokenizer,
    pub language: Language,
    pub lowercase: bool,
    pub ascii_folding: bool,
    pub stopwords: Option<Stopwords>,
    pub stemmer: Option<Stemmer>,
    pub min_token_len: Option<usize>,
    pub max_token_len: Option<usize>,
}
Expand description

Full BM25 text-processing configuration — mirrors Qdrant’s Bm25Config.

Construct via Bm25TextConfig::resolve (flat stringly options, the single choke point every config surface calls) or struct-literal with ..Default::default(). Numeric parameters validate through Bm25Params; names parse through Language/Tokenizer/Stemmer.

Fields§

§params: Bm25Params

Validated k1/b/avg_len.

§tokenizer: Tokenizer

Tokenizer (default Tokenizer::Word).

§language: Language

Language for default stopwords/stemmer (default English, like Qdrant).

§lowercase: bool

Lowercase before matching (default true, like Qdrant).

§ascii_folding: bool

Lucene ASCII folding before lowercasing (default false, like Qdrant).

§stopwords: Option<Stopwords>

Stopword override (None = language default).

§stemmer: Option<Stemmer>

Stemmer override (None = language default).

§min_token_len: Option<usize>

Drop tokens shorter than this (chars, always enforced, like Qdrant).

§max_token_len: Option<usize>

Drop tokens longer than this (chars; on the document path, like Qdrant — the prefix query path truncates instead).

Implementations§

Source§

impl Bm25TextConfig

Source

pub fn resolve( k1: Option<f64>, b: Option<f64>, avg_len: Option<f64>, language: Option<&str>, tokenizer: Option<&str>, lowercase: Option<bool>, ascii_folding: Option<bool>, stopwords: Option<Vec<String>>, stemmer: Option<&str>, min_token_len: Option<usize>, max_token_len: Option<usize>, stopwords_languages: Option<Vec<String>>, ) -> Result<Self, QqlError>

Resolve flat options into a validated config. None keeps the corresponding default; invalid names or numbers fail closed with QQL-VALIDATION-CONFIG.

  • stopwords: None = language default; Some(list) replaces it with exactly list (empty disables filtering). Use stopwords_languages to merge additional language lists instead.
  • stopwords_languages: additional language lists merged with stopwords (Qdrant Set.languages). An explicit selection replaces the default, so include the processing language to keep its words. Invalid names fail closed.
  • stemmer: None = language default; Some("none") disables; Some("<language>") overrides.
  • tokenizer: "multilingual" parses here but fails at embed time (see Tokenizer::Multilingual).
Source

pub fn with_text_options( &self, language: Option<&str>, tokenizer: Option<&str>, lowercase: Option<bool>, ascii_folding: Option<bool>, stopwords: Option<Vec<String>>, stemmer: Option<&str>, min_token_len: Option<usize>, max_token_len: Option<usize>, stopwords_languages: Option<Vec<String>>, ) -> Result<Self, QqlError>

Update text knobs over the current config: None (or empty names) keeps self’s value, explicit values replace it. Unlike Bm25TextConfig::resolve, where None means “Qdrant default”, this is the incremental-update path (WASM setBm25Text, REPL-style tuning): previously configured values survive untouched knobs. Names validate exactly like Bm25TextConfig::resolve. There is no reset-to-default signal: to restore defaults, resolve a fresh Bm25TextConfig::default instead of updating.

Source

pub fn pipeline(&self) -> Bm25Pipeline

Compile into an executable pipeline. Infallible: names already validated at parse/resolve time; remaining choices are total.

Trait Implementations§

Source§

impl Clone for Bm25TextConfig

Source§

fn clone(&self) -> Bm25TextConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Bm25TextConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Bm25TextConfig

Source§

fn default() -> Self

Qdrant server defaults: k1 = 1.2, b = 0.75, avg_len = 256, word tokenizer, English, lowercase on, folding off, language stopwords/stemmer, no length limits.

Source§

impl PartialEq for Bm25TextConfig

Source§

fn eq(&self, other: &Bm25TextConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Bm25TextConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EmbedderBound for T
where T: Send + Sync,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.