pub struct VectorIndex {
pub name: String,
pub property: NamedNode,
pub dimensions: u32,
pub metric: Metric,
pub element_type: ElementType,
pub class: Option<NamedNode>,
}Expand description
A vector index definition.
Fields§
§name: String§property: NamedNodeThe property whose literal values are embeddings ("[0.1, 0.2, …]").
dimensions: u32§metric: Metric§element_type: ElementType§class: Option<NamedNode>Only instances of this class are candidates.
Implementations§
Source§impl VectorIndex
impl VectorIndex
Sourcepub fn new(
name: impl Into<String>,
property: NamedNode,
dimensions: u32,
) -> Self
pub fn new( name: impl Into<String>, property: NamedNode, dimensions: u32, ) -> Self
A cosine, 32-bit float index.
pub fn metric(self, metric: Metric) -> Self
pub fn element_type(self, element_type: ElementType) -> Self
pub fn class(self, class: NamedNode) -> Self
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks the name, the dimensions and the metric/element-type combination.
Sourcepub fn table(&self) -> String
pub fn table(&self) -> String
The table holding the embeddings (lower case: SQLite names ignore case).
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Everything the built table depends on.
Sourcepub fn create_statements(&self, caps: &Capabilities) -> Result<Vec<Statement>>
pub fn create_statements(&self, caps: &Capabilities) -> Result<Vec<Statement>>
Statements creating the table, its triggers (and IVF index), back-filling it and recording its fingerprint. Run them in one atomic request: a malformed existing value aborts the back-fill, and with it the whole creation.
Trait Implementations§
Source§impl Clone for VectorIndex
impl Clone for VectorIndex
Source§impl Debug for VectorIndex
impl Debug for VectorIndex
impl Eq for VectorIndex
Source§impl PartialEq for VectorIndex
impl PartialEq for VectorIndex
impl StructuralPartialEq for VectorIndex
Auto Trait Implementations§
impl Freeze for VectorIndex
impl RefUnwindSafe for VectorIndex
impl Send for VectorIndex
impl Sync for VectorIndex
impl Unpin for VectorIndex
impl UnsafeUnpin for VectorIndex
impl UnwindSafe for VectorIndex
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