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>) -> Point
pub fn new(id: PointId, vector: Vector, payload: Option<Value>) -> Point
Create a new point with a single dense vector
Sourcepub fn new_multi(
id: PointId,
multivector: MultiVector,
payload: Option<Value>,
) -> Point
pub fn new_multi( id: PointId, multivector: MultiVector, payload: Option<Value>, ) -> Point
Create a new point with a multivector (ColBERT-style)
Sourcepub fn new_sparse(
id: PointId,
sparse_vectors: HashMap<String, SparseVector>,
payload: Option<Value>,
) -> Point
pub fn new_sparse( id: PointId, sparse_vectors: HashMap<String, SparseVector>, payload: Option<Value>, ) -> Point
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) -> Point
pub fn with_multivector(self, multivector: MultiVector) -> Point
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Point
impl<'de> Deserialize<'de> for Point
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Point, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Point, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Point
impl Serialize for Point
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request