pub struct AddPostings;Expand description
Add Postings operation
Adds a collection of document postings to the index. The index must already be initialized in the context.
§Context Requirements
- Context must have an initialized index
- All postings must have consistent vector dimensions
§Example
use shardex::api::{ShardexContext, AddPostingsParams, CreateIndexParams};
use shardex::api::operations::{AddPostings, CreateIndex};
use shardex::{Posting, DocumentId};
use apithing::ApiOperation;
let postings = vec![
Posting {
document_id: DocumentId::from_raw(1),
start: 0,
length: 100,
vector: vec![0.1; 384],
}
];
let params = AddPostingsParams::new(postings)?;
AddPostings::execute(&mut context, ¶ms)?;Trait Implementations§
Source§impl ApiOperation<ShardexContext, AddPostingsParams> for AddPostings
impl ApiOperation<ShardexContext, AddPostingsParams> for AddPostings
Source§type Error = ShardexError
type Error = ShardexError
The error type returned when an operation fails.
Source§fn execute(
context: &mut ShardexContext,
parameters: &AddPostingsParams,
) -> Result<Self::Output, Self::Error>
fn execute( context: &mut ShardexContext, parameters: &AddPostingsParams, ) -> Result<Self::Output, Self::Error>
Execute the API operation with the given context and properties.
Auto Trait Implementations§
impl Freeze for AddPostings
impl RefUnwindSafe for AddPostings
impl Send for AddPostings
impl Sync for AddPostings
impl Unpin for AddPostings
impl UnwindSafe for AddPostings
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, C, P> Execute<C, P> for Twhere
T: ApiOperation<C, P>,
impl<T, C, P> Execute<C, P> for Twhere
T: ApiOperation<C, P>,
Source§type Output = <T as ApiOperation<C, P>>::Output
type Output = <T as ApiOperation<C, P>>::Output
The type returned by a successful operation execution.
Source§type Error = <T as ApiOperation<C, P>>::Error
type Error = <T as ApiOperation<C, P>>::Error
The error type returned when an operation fails.
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 more