pub struct SearchParams {
pub ivfflat_probes: Option<usize>,
pub hnsw_ef_search: Option<usize>,
}Expand description
Configuration for setting pgvector search parameters.
These SET commands tune the behavior of approximate index scans.
Fields§
§ivfflat_probes: Option<usize>Number of IVFFlat lists to probe (default: 1).
Higher values improve recall at the cost of speed.
hnsw_ef_search: Option<usize>HNSW search ef parameter (default: 40).
Higher values improve recall at the cost of speed.
Implementations§
Source§impl SearchParams
impl SearchParams
Sourcepub fn to_set_sql(&self) -> Vec<String>
pub fn to_set_sql(&self) -> Vec<String>
Generate the SET commands for these parameters.
Sourcepub fn has_params(&self) -> bool
pub fn has_params(&self) -> bool
Check if any parameters are set.
Trait Implementations§
Source§impl Clone for SearchParams
impl Clone for SearchParams
Source§fn clone(&self) -> SearchParams
fn clone(&self) -> SearchParams
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 SearchParams
impl Debug for SearchParams
Source§impl Default for SearchParams
impl Default for SearchParams
Source§impl<'de> Deserialize<'de> for SearchParams
impl<'de> Deserialize<'de> for SearchParams
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
Auto Trait Implementations§
impl Freeze for SearchParams
impl RefUnwindSafe for SearchParams
impl Send for SearchParams
impl Sync for SearchParams
impl Unpin for SearchParams
impl UnsafeUnpin for SearchParams
impl UnwindSafe for SearchParams
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