pub struct Point {
pub id: PointId,
pub version: u64,
pub vector: Vector,
pub multivector: Option<MultiVector>,
pub sparse_vectors: HashMap<String, SparseVector>,
pub payload: Option<Value>,
}Expand description
A point in the vector space with optional payload
Fields§
§id: PointId§version: u64Version number - incremented on each update
vector: VectorVector data - backwards compatible field name
multivector: Option<MultiVector>Optional multivector data for ColBERT-style search
sparse_vectors: HashMap<String, SparseVector>Named sparse vectors (e.g., {“keywords”: SparseVector})
payload: Option<Value>Implementations§
Source§impl Point
impl Point
Sourcepub fn new(id: PointId, vector: Vector, payload: Option<Value>) -> Self
pub fn new(id: PointId, vector: Vector, payload: Option<Value>) -> Self
Create a new point with a single dense vector
Sourcepub fn new_multi(
id: PointId,
multivector: MultiVector,
payload: Option<Value>,
) -> Self
pub fn new_multi( id: PointId, multivector: MultiVector, payload: Option<Value>, ) -> Self
Create a new point with a multivector (ColBERT-style)
Sourcepub fn new_sparse(
id: PointId,
sparse_vectors: HashMap<String, SparseVector>,
payload: Option<Value>,
) -> Self
pub fn new_sparse( id: PointId, sparse_vectors: HashMap<String, SparseVector>, payload: Option<Value>, ) -> Self
Create a new point with sparse vectors
Sourcepub fn add_sparse_vector(&mut self, name: String, sparse: SparseVector)
pub fn add_sparse_vector(&mut self, name: String, sparse: SparseVector)
Add a sparse vector to this point
Sourcepub fn get_sparse_vector(&self, name: &str) -> Option<&SparseVector>
pub fn get_sparse_vector(&self, name: &str) -> Option<&SparseVector>
Get a sparse vector by name
Sourcepub fn has_multivector(&self) -> bool
pub fn has_multivector(&self) -> bool
Check if this point has multivector data
Sourcepub fn get_multivector(&self) -> Option<&MultiVector>
pub fn get_multivector(&self) -> Option<&MultiVector>
Get the multivector if present
pub fn with_payload(self, payload: Value) -> Self
pub fn with_multivector(self, multivector: MultiVector) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Point
impl<'de> Deserialize<'de> for Point
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 Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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